We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56941b4 commit 35613e4Copy full SHA for 35613e4
src/useMergeState.ts
@@ -25,7 +25,7 @@ export type MergeStateSetter<TState> = (
25
* @param initialState The initial state object
26
*/
27
export default function useMergeState<TState extends {}>(
28
- initialState: TState,
+ initialState: TState | (() => TState),
29
): [TState, MergeStateSetter<TState>] {
30
const [state, setState] = useState<TState>(initialState)
31
0 commit comments