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

Function onStorage

packages/react-devtools-shared/src/devtools/views/hooks.js:203–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 useLayoutEffect(() => {
202 // $FlowFixMe[missing-local-annot]
203 const onStorage = event => {
204 const newValue = getValueFromLocalStorage();
205 if (key === event.key && storedValue !== newValue) {
206 setValue(newValue);
207 }
208 };
209
210 window.addEventListener('storage', onStorage);
211 return () => {

Callers

nothing calls this directly

Calls 1

setValueFunction · 0.85

Tested by

no test coverage detected