Skip to content

Commit d2330c1

Browse files
committed
docs: minor improvements
1 parent 26ee93b commit d2330c1

File tree

3 files changed

+69
-71
lines changed

3 files changed

+69
-71
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@
7676
"jiti": "^2.4.2",
7777
"lefthook": "^1.11.13",
7878
"markdownlint": "^0.38.0",
79-
"nx": "20.8.1",
79+
"nx": "21.1.2",
8080
"publint": "^0.3.12",
8181
"react": "^19.1.0",
8282
"react-dom": "^19.1.0",
8383
"skott": "^0.35.4",
8484
"tinyexec": "^1.0.1",
85-
"tinyglobby": "^0.2.13",
85+
"tinyglobby": "^0.2.14",
8686
"ts-pattern": "^5.7.1",
8787
"tslib": "^2.8.1",
8888
"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: 58 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)