()
| 3 | |
| 4 | /** Return a function that re-renders this component, if still mounted */ |
| 5 | export function useForceUpdate() { |
| 6 | const update = useState<any>()[1] |
| 7 | const isMounted = useIsMounted() |
| 8 | return () => { |
| 9 | if (isMounted.current) { |
| 10 | update(Math.random()) |
| 11 | } |
| 12 | } |
| 13 | } |
no test coverage detected
searching dependent graphs…