We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
zeit-ui/react
When using a table like this:
() => { const data = [ { property: 'type', description: 'Content type', type: 'secondary | warning', default: '-' }, { property: 'Component', description: 'DOM element to use', type: 'string', default: '-' }, { property: 'bold', description: 'Bold style', type: 'boolean', default: 'true' }, ] const [state, setState] = React.useState(0) React.useEffect(() => { const interval = setInterval(() => { setState((old) => old + 1) }, 1000) return () => { clearInterval(interval) } }, []) return ( <Table data={data}> <Table.Column prop="property" label="property" /> <Table.Column prop="description" label={`description: ${state}`} /> <Table.Column prop="type" label="type" /> <Table.Column prop="default" label="default" /> </Table> ) }
The description label prop is not being updated. This is a "minimal" reproducable example, I'm not doing exactly this in my application.
The description label prop isn't being updated, even though the variable state is being updated.
state
The text was updated successfully, but these errors were encountered:
@merisbahti The pre-release version v1.8.0-canary.9 is out now, it should solve this issue.
v1.8.0-canary.9
Sorry, something went wrong.
Interesting, thanks. In a way, it does solve the issue, however it's not super obvious to me.
For example, this still does not work:
() => { const data = [ { property: 'type', description: 'Content type', type: 'secondary | warning', default: '-' }, { property: 'Component', description: 'DOM element to use', type: 'string', default: '-' }, { property: 'bold', description: 'Bold style', type: 'boolean', default: 'true' }, ] const [state, setState] = React.useState(0) React.useEffect(() => { const interval = setInterval(() => { setState((old) => old + 1) }, 1000) return () => { clearInterval(interval) } }, []) return ( <Table data={data}> <Table.Column prop="description"> Description: {state} </Table.Column> </Table> ) }
However, if you stringify the state in the label, like this:
<Table.Column prop="description" label={state}> Description: {state} </Table.Column>
it updates as expected. Is this expected?
Sorry, this is my negligence. I created an online example using version 1.8.0-canary.10, the table children should be sync correctly now.
1.8.0-canary.10
children
unix
No branches or pull requests
Bug report 🐞
Version & Environment
zeit-ui/react
: ^1.8.0-canary.0Expection
When using a table like this:
The description label prop is not being updated. This is a "minimal" reproducable example, I'm not doing exactly this in my application.
Actual results (or Errors)
The description label prop isn't being updated, even though the variable
state
is being updated.The text was updated successfully, but these errors were encountered: