dillon1000/react
Commit
Browse files Cleanup enableUseRefAccessWarning flag (#28699)
Cleanup enableUseRefAccessWarning flag I don't think this flag has a path forward in the current implementation. The detection by stack trace is too brittle to detect the lazy initialization pattern reliably (see e.g. some internal tests that expect the warning because they use lazy intialization, but a slightly different pattern then the expected pattern. I think a new version of this could be to fully ban ref access during render with an alternative API for the exceptional cases that today require ref access during render.
Changed paths13 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberHooks.js ModifiedM packages/react-reconciler/src/__tests__/useRef-test.internal.js ModifiedM packages/shared/ReactFeatureFlags.js ModifiedM packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js ModifiedM packages/shared/forks/ReactFeatureFlags.native-fb.js ModifiedM packages/shared/forks/ReactFeatureFlags.native-oss.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js ModifiedM packages/shared/forks/ReactFeatureFlags.test-renderer.www.js ModifiedM packages/shared/forks/ReactFeatureFlags.www-dynamic.js ModifiedM packages/shared/forks/ReactFeatureFlags.www.js ModifiedM packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js ModifiedM packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…