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

Function App

packages/react-reconciler/src/__tests__/useSyncExternalStore-test.js:247–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245 const store = createExternalStore('value:initial');
246
247 function App() {
248 const value = useSyncExternalStore(store.subscribe, store.getState);
249 const [sameValue, setSameValue] = useState(value);
250 if (value !== sameValue) setSameValue(value);
251 return <Text text={value} />;
252 }
253
254 const root = ReactNoop.createRoot();
255 await act(() => {

Callers

nothing calls this directly

Calls 2

useSyncExternalStoreFunction · 0.50
useStateFunction · 0.50

Tested by

no test coverage detected