MCPcopy Create free account
hub / github.com/react/react / experimental_useOptimistic

Function experimental_useOptimistic

packages/react/index.experimental.development.js:65–76  ·  view source on GitHub ↗
(
  passthrough: S,
  reducer: ?(S, A) => S,
)

Source from the content-addressed store, hash-verified

63import {useOptimistic} from './src/ReactClient';
64
65export function experimental_useOptimistic<S, A>(
66 passthrough: S,
67 reducer: ?(S, A) => S,
68): [S, (A) => void] {
69 if (__DEV__) {
70 console.error(
71 'useOptimistic is now in canary. Remove the experimental_ prefix. ' +
72 'The prefixed alias will be removed in an upcoming release.',
73 );
74 }
75 return useOptimistic(passthrough, reducer);
76}

Callers

nothing calls this directly

Calls 2

errorMethod · 0.65
useOptimisticFunction · 0.50

Tested by

no test coverage detected