Skip to content

Commit a508ba5

Browse files
committed
docs: update descriptions and add "See Also" sections for component nesting rules
1 parent 2cc4027 commit a508ba5

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-nested-component-definitions.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ react-x/no-nested-component-definitions
2323

2424
## Description
2525

26-
Prevents nesting component definitions inside other components.
26+
Disallow nesting component definitions inside other components.
2727

2828
Nesting component definitions inside other components is a common mistake that can be extremely slow and cause issues and bugs, and the state of components defined during rendering will not be preserved by React. Instead, define every component at the top level.
2929

@@ -65,3 +65,10 @@ When a child component needs some data from a parent, [pass it by props](https:/
6565
## Further Reading
6666

6767
- [React: Nesting and organizing components](https://react.dev/learn/your-first-component#nesting-and-organizing-components)
68+
69+
---
70+
71+
## See Also
72+
73+
- [`no-nested-lazy-component-declarations`](./no-nested-lazy-component-declarations.md)\
74+
Disallow nesting lazy component declarations inside other components.

packages/plugins/eslint-plugin-react-x/src/rules/no-nested-lazy-component-declarations.md

+7
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@ function Editor() {
6464
## Further Reading
6565

6666
- [React: Nesting and organizing components](https://react.dev/learn/your-first-component#nesting-and-organizing-components)
67+
68+
---
69+
70+
## See Also
71+
72+
- [`no-nested-component-definitions`](./no-nested-component-definitions.md)\
73+
Disallow nesting component definitions inside other components.

0 commit comments

Comments
 (0)