Created
May 10, 2020 12:27
-
-
Save ahtcx/7205692d3842ebee9175e1274d4c7b50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback, useState } from "react"; | |
export const useForceUpdate = () => { | |
const [, dispatch] = useState(Object.create(null)); | |
return useCallback(() => dispatch(Object.create(null)), [dispatch]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment