Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] React.StrictMode support for grammatical tags #990

Open
xinyifly opened this issue Jan 24, 2024 · 0 comments
Open

[Feature] React.StrictMode support for grammatical tags #990

xinyifly opened this issue Jan 24, 2024 · 0 comments
Assignees

Comments

@xinyifly
Copy link

xinyifly commented Jan 24, 2024

What problem does this feature solve?

import React from 'react'
import ReactDOM from 'react-dom/client'
import { ListColumn, ListTable } from '@visactor/react-vtable'

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <div style={{ height: '500px' }}>
      <ListTable records={new Array(10).fill(['John', 18, 'male', '🏀'])}>
        <ListColumn field={'0'} caption={'name'} />
        <ListColumn field={'1'} caption={'age'} />
        <ListColumn field={'2'} caption={'gender'} />
        <ListColumn field={'3'} caption={'hobby'} />
      </ListTable>
    </div>
  </React.StrictMode>,
)

This throws Uncaught TypeError: Cannot read properties of null (reading 'optionFromChildren')

Without React.StrictMode or use option instead it works properly.

What does the proposed API look like?

<React.StrictMode>
  <ListTable>
    <ListColumn />
  </ListTable>
</React.StrictMode>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants