mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
b8c96b136d
Only certain fiber types can have refs attached to them, so this moves the Ref effect logic out of the common path and into the corresponding branch of the layout phase's switch statement. The types of fibers this affects are host components and class components. Function components are not affected because they can only have a ref via useImperativeHandle, which has a different implementation. The experimental Scope type attaches its refs in the mutation phase, not the layout phase.