T
TanStack3y ago
other-emerald

Defining columns inside function components

https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md when I am trying to define my column array inside a function component, whereas in the examples the columns are defined inside the function component, https://codesandbox.io/s/gallant-austin-kn24pq?file=/src/main.tsx:701-723 can someone help me with this please
GitHub
eslint-plugin-react/no-unstable-nested-components.md at master · js...
React-specific linting rules for ESLint. Contribute to jsx-eslint/eslint-plugin-react development by creating an account on GitHub.
1 Reply
other-emerald
other-emeraldOP3y ago
As far as I know nested components are considered a bad practice for performance reasons https://codepen.io/ariperkkio/pen/vYLodLB confused as to why some examples in the doc suggest it
Ari Perkkiö
CodePen
React children losing state; nested component's element type changing
Detailed example of a reusable React component with unstable childrens' state. tldr; do not define components inside components....

Did you find this page helpful?