Repository navigation
fix(web): update the wrapper's refs before layout effects - #33
Conversation
The handler and prop refs were written in a layout effect, which runs in tree order. A component earlier in the tree that focused the editor from its own layout effect reached the onFocus of the previous commit. The refs are now written in an insertion effect, which React runs before every layout effect.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
#32 moved the wrapper's handler and prop refs to a layout effect. layout effects run in tree order, so a component earlier in the tree that focused the editor from its own layout effect still got the
onFocusfrom the commit before. both refs are written in an insertion effect now, React runs those before any layout effect, so the refs are current for every layout effect and still never hold a dropped render's values.