[v8] What is the best way to define cell rendering using React #4184
Unanswered
marceloverdijk
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I had trouble reproducing this error in a Storybook environment but I think the re-rendering issue is from you declaring a react component on the fly maybe? I think this might be resolved by composing a component above the spreading the props into the component. This way the component is declared separately from the columns but you are just calling it and passing it props to the called component. Something like this:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I understand TanStack/table is headless so it's not related to table itself, but I wonder how others do this.
I'm probably not the only one ;-)
When having column definition I sometimes need to render more than just the value of the cell. E.g. a country flag as can be seen below.
However eslint complains with:
See https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
Now 1) I wonder if above code is performant or not? If that's not the problem I could simply ignore the eslint warning.
And 2) if it is not performant, what should be the best approach to implement this? (using type safety)
Thanks for your advise.
M
Beta Was this translation helpful? Give feedback.
All reactions