File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
packages/plugins/eslint-plugin-react-x/src/rules Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,24 @@ function MyComponent() {
6868}
6969```
7070
71+ ``` tsx
72+ function MyComponent() {
73+ // hooks etc
74+
75+ const thingsList = useMemo (() => things .filter (callback ), [things , callback ]);
76+
77+ return (
78+ <SomeJsx >
79+ <SomeMoreJsx />
80+ { thingsList .length === 0
81+ ? <Empty />
82+ : thingsList .map ((thing ) => <Thing key = { thing .id } data = { thing } />)}
83+ <SomeMoreJsx />
84+ </SomeJsx >
85+ );
86+ }
87+ ```
88+
7189``` tsx
7290function MyComponent() {
7391 // hooks etc
@@ -80,7 +98,7 @@ function MyComponent() {
8098 }
8199
82100 return filteredThings .map ((thing ) => <Thing key = { thing .id } data = { thing } />);
83- }, [things ]);
101+ }, [things , callback ]);
84102
85103 return (
86104 <SomeJsx >
You can’t perform that action at this time.
0 commit comments