Skip to content

Commit 460d9d5

Browse files
committed
Enable usage of string-refs codemod
1 parent 4e74ec4 commit 460d9d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react/src/ReactBaseClasses.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77

88
import ReactNoopUpdateQueue from './ReactNoopUpdateQueue';
99
import assign from 'shared/assign';
10+
import {warnAboutStringRefs} from 'shared/ReactFeatureFlags';
1011

1112
const emptyObject = {};
12-
if (__DEV__) {
13+
if (
14+
__DEV__ &&
15+
// For string refs we recommend the `string-refs` codemod that requires unsealed `this.refs`
16+
!warnAboutStringRefs
17+
) {
1318
Object.freeze(emptyObject);
1419
}
1520

0 commit comments

Comments
 (0)