MCPcopy
hub / github.com/facebook/react / experimental_useOptimistic

Function experimental_useOptimistic

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

errorMethod · 0.65
useOptimisticFunction · 0.50

Tested by

no test coverage detected