| 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 () => { |
nothing calls this directly
no test coverage detected