Commit b285048
Fix require order and improve React component performance
Redux Generator:
- Move GeneratorMessages require to top of file to fix load order
- Fix detect_package_manager calls to use proper module method
- Remove duplicate require statement in add_redux_specific_messages
React Component Improvements:
- Use modern JSX transform (remove React import)
- Add useMemo to prevent store recreation on re-renders
- Use type-only imports for better tree-shaking
- Switch from React.FC to FC import
Addresses additional code review feedback for performance and correctness.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent c721d4e commit b285048
File tree
2 files changed
+13
-9
lines changed- lib/generators/react_on_rails
- templates/redux/base/app/javascript/bundles/HelloWorld/startup
2 files changed
+13
-9
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
0 commit comments