Skip to content

Commit b5af51d

Browse files
committed
[crud] Only export uRC when flag is enabled
It's tricky to do feature detection of uRC currently because it's always present on the export. Let's conditionally export it instead.
1 parent aba370f commit b5af51d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react/src/ReactHooks.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export function useEffectEvent<Args, F: (...Array<Args>) => mixed>(
229229
return dispatcher.useEffectEvent(callback);
230230
}
231231

232-
export function useResourceEffect(
232+
function useResourceEffect_(
233233
create: () => mixed,
234234
createDeps: Array<mixed> | void | null,
235235
update: ((resource: mixed) => void) | void,
@@ -250,6 +250,10 @@ export function useResourceEffect(
250250
);
251251
}
252252

253+
export const useResourceEffect = enableUseResourceEffectHook
254+
? useResourceEffect_
255+
: null;
256+
253257
export function useOptimistic<S, A>(
254258
passthrough: S,
255259
reducer: ?(S, A) => S,

0 commit comments

Comments
 (0)