Repository navigation
Commit bbb1fe8
committed
fix(compiler): stop seedRenderReads from over-nominating non-binding identifiers
The render-read scan in collectUseArgumentRoots had two over-nomination
issues that caused handler-only calculations and property-name collisions
to be wrongly wrapped in useMemo:
1. Non-computed MemberExpression properties (e.g. `length` in
`visible.length`) and non-computed Property keys were treated as
binding references. Add explicit handlers that walk only the
binding-relevant children, matching collectFreeIdentifiers.
2. Nested function bodies (event handlers like `onClick={() => fn(x)}`)
were walked with inRenderTree=true, seeding identifiers that are only
accessed when the event fires. Reset inRenderTree to false when
entering function bodies; the existing nextInRenderTree logic
re-enters render-tree mode at any JSX boundary inside.1 parent fe0f933 commit bbb1fe8
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10774 | 10774 | | |
10775 | 10775 | | |
10776 | 10776 | | |
10777 | | - | |
| 10777 | + | |
| 10778 | + | |
| 10779 | + | |
| 10780 | + | |
| 10781 | + | |
| 10782 | + | |
10778 | 10783 | | |
10779 | 10784 | | |
10780 | 10785 | | |
| |||
10811 | 10816 | | |
10812 | 10817 | | |
10813 | 10818 | | |
| 10819 | + | |
| 10820 | + | |
| 10821 | + | |
| 10822 | + | |
| 10823 | + | |
| 10824 | + | |
| 10825 | + | |
| 10826 | + | |
| 10827 | + | |
| 10828 | + | |
| 10829 | + | |
| 10830 | + | |
10814 | 10831 | | |
10815 | 10832 | | |
10816 | 10833 | | |
| |||
0 commit comments