Skip to content

Commit e77e16c

Browse files
committed
add comment
1 parent b481508 commit e77e16c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-reconciler/src/ReactFiberClassComponent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,9 @@ function mountClassInstance(
821821
instance.props = newProps;
822822
instance.state = workInProgress.memoizedState;
823823
if (!disableStringRefs) {
824+
// When string refs are used in create-react-class legacy components,
825+
// we need to make refs writable unless we patch all such copies of the
826+
// class code that sets to a frozen emptyObject.
824827
instance.refs = {};
825828
}
826829

0 commit comments

Comments
 (0)