Skip to content

Don't ignore react/no-unstable-nested-components eslint rule #22

@brian-smith-tcril

Description

@brian-smith-tcril

When testing #10 locally I tried removing this line

// eslint-disable-next-line react/no-unstable-nested-components

and running npm run lint to see the full error

104:19 error Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “TeamTable” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true react/no-unstable-nested-components

I then saw that this wasn't the first place in the file the rule was being ignored

// eslint-disable-next-line react/no-unstable-nested-components

It'd be good to clean up any places we're ignoring this.

Relevant links:

Metadata

Metadata

Labels

bugReport of or fix for something that isn't working as intendedcode healthProactive technical investment via refactorings, removals, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions