Document useReactiveState

This commit is contained in:
Robin Townsend 2023-02-15 16:38:49 -05:00
parent fbc72283d4
commit 1fc181dc28

View file

@ -23,6 +23,11 @@ import {
useState,
} from "react";
/**
* Hook creating a stateful value that updates automatically whenever the
* dependencies change. Or equivalently, a version of useMemo that takes its own
* previous value as an input, and can be updated manually.
*/
export const useReactiveState = <T>(
updateFn: (prevState?: T) => T,
deps: DependencyList