diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js index 797eb57f6a632..d7f9d00e79bcf 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.js +++ b/packages/react-reconciler/src/ReactFiberHooks.js @@ -5241,8 +5241,8 @@ if (__DEV__) { return mountEvent(callback); }; } - if (InvalidNestedHooksDispatcherOnMountInDEV) { - (HooksDispatcherOnRerenderInDEV: Dispatcher).useResourceEffect = + if (enableUseResourceEffectHook) { + (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useResourceEffect = function useResourceEffect( create: () => mixed, createDeps: Array | void | null,