Skip to content

Commit 3080748

Browse files
committed
docs: minor improvements
2 parents d6a7141 + d2330c1 commit 3080748

File tree

3 files changed

+67
-69
lines changed

3 files changed

+67
-69
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@
7575
"jiti": "^2.4.2",
7676
"lefthook": "^1.11.13",
7777
"markdownlint": "^0.38.0",
78-
"nx": "20.8.1",
78+
"nx": "21.1.2",
7979
"publint": "^0.3.12",
8080
"react": "^19.1.0",
8181
"react-dom": "^19.1.0",
8282
"skott": "^0.35.4",
8383
"tinyexec": "^1.0.1",
84-
"tinyglobby": "^0.2.13",
84+
"tinyglobby": "^0.2.14",
8585
"ts-pattern": "^5.7.1",
8686
"tslib": "^2.8.1",
8787
"tsup": "^8.5.0",

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@ react-x/no-nested-lazy-component-declarations
2323

2424
## Description
2525

26-
Disallow nesting lazy component declarations inside other components.
26+
Disallows defining React components inside other components.
2727

28-
When a lazy component is declared inside another component, it will be re-created on every render of the parent component. This can lead to unexpected behavior, such as resetting the state of the lazy component.
28+
Component definitions inside other components cause them to be recreated on every render, which can lead to performance issues and unexpected behavior.
29+
30+
When a component is defined inside another component:
31+
32+
- It gets recreated on every render of the parent component
33+
- It loses its internal state when the parent rerenders
34+
- It defeats props memoization and optimization techniques
35+
- It creates new function references on every render
2936

3037
## Examples
3138

pnpm-lock.yaml

Lines changed: 56 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)