Skip to content

Commit b8ae202

Browse files
committed
Fix typescript
1 parent be9f658 commit b8ae202

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/hooks/useIntermediateState.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
import { useCallback, useEffect, useMemo, useState } from 'react';
22

3-
export type IntermediateState<T> = {
4-
state: T;
5-
setState: (value: T) => void;
6-
reset: VoidFunction;
7-
cancel: VoidFunction;
8-
};
9-
10-
const useIntermediateState = <T,>(
11-
value: T,
12-
defaultValue: T = value
13-
): IntermediateState<T> => {
3+
const useIntermediateState = <T,>(value: T, defaultValue: T = value) => {
144
const [state, setState] = useState<T>(value);
155

166
const reset = useCallback(() => setState(defaultValue), [defaultValue]);

0 commit comments

Comments
 (0)