Skip to content

Commit

Permalink
[crud] Only export uRC when flag is enabled
Browse files Browse the repository at this point in the history
It's tricky to do feature detection of uRC currently because it's always present on the export. Let's conditionally export it instead.
  • Loading branch information
poteto committed Nov 22, 2024
1 parent aba370f commit b5e9a9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/ReactClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {startTransition} from './ReactStartTransition';
import {act} from './ReactAct';
import {captureOwnerStack} from './ReactOwnerStack';
import ReactCompilerRuntime from './ReactCompilerRuntime';
import {enableUseResourceEffectHook} from 'shared/ReactFeatureFlags';

const Children = {
map,
Expand All @@ -90,7 +91,6 @@ export {
useContext,
useEffect,
useEffectEvent as experimental_useEffectEvent,
useResourceEffect as experimental_useResourceEffect,
useImperativeHandle,
useDebugValue,
useInsertionEffect,
Expand Down Expand Up @@ -131,3 +131,6 @@ export {
act, // DEV-only
captureOwnerStack, // DEV-only
};

export const experimental_useResourceEffect: typeof useResourceEffect | null =
enableUseResourceEffectHook ? useResourceEffect : null;

0 comments on commit b5e9a9e

Please sign in to comment.