Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Last active July 3, 2019 16:15
Show Gist options
  • Save treyhuffine/6a6255a32e9086dfe2376d9bf5001aeb to your computer and use it in GitHub Desktop.
Save treyhuffine/6a6255a32e9086dfe2376d9bf5001aeb to your computer and use it in GitHub Desktop.
function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
type Dispatch<A> = (value: A) => void;
type SetStateAction<S> = S | ((prevState: S) => S);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment