Closed gaearon closed 3 days ago
Old size | New size | Diff |
---|---|---|
8.05 MB | 8.05 MB | 0 B (0.00%) |
Curious, how does this prevent eager JSX creation? Since the new, extracted function does not contain e.g. an early return, I would expect identical JSX to be created before and after. 🤔
JSX is lazy, so <Foo />
doesn't call Foo
unless React recursively gets to it via the parent tree. In this case, <Dialog.Outer>
conditionally renders its children, so it would never get to the inner child while the dialog is closed.
The usual refactor to avoid creating JSX eagerly.
Test Plan
Repost button and dialog still works on iOS, Android.