Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3276,6 +3276,11 @@ describe('ReactHooksWithNoopRenderer', () => {
}
}

// @gate !enableUseResourceEffectHook
it('is null when flag is disabled', async () => {
expect(useResourceEffect).toBeUndefined();
});

// @gate enableUseResourceEffectHook
it('validates create return value', async () => {
function App({id}) {
Expand Down
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 | void =
enableUseResourceEffectHook ? useResourceEffect : undefined;
Loading