Created
April 18, 2022 00:00
-
-
Save MarekZeman91/106e408d922ee47c107ca98aa95109b1 to your computer and use it in GitHub Desktop.
This file contains 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 { useMemo } from 'react'; | |
export const useConst = <T>(initialStateGetter: () => T) => { | |
return useMemo(initialStateGetter, []); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment