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 8d95759
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/ReactHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function useEffectEvent<Args, F: (...Array<Args>) => mixed>(
return dispatcher.useEffectEvent(callback);
}

export function useResourceEffect(
function useResourceEffect_(
create: () => mixed,
createDeps: Array<mixed> | void | null,
update: ((resource: mixed) => void) | void,
Expand All @@ -250,6 +250,9 @@ export function useResourceEffect(
);
}

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

export function useOptimistic<S, A>(
passthrough: S,
reducer: ?(S, A) => S,
Expand Down

0 comments on commit 8d95759

Please sign in to comment.