Skip to content

Commit

Permalink
fix #1015
Browse files Browse the repository at this point in the history
  • Loading branch information
uNmAnNeR committed Mar 21, 2024
1 parent ea4e8f1 commit 8b4944f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-imask/src/hook.ts
Expand Up @@ -9,7 +9,8 @@ function useIMask<
Opts extends FactoryOpts=FactoryOpts,
>(
opts: Opts,
{ onAccept, onComplete }: {
{ onAccept, onComplete, ref=useRef<MaskElement | null>(null) }: {
ref?: MutableRefObject<MaskElement | null>,
onAccept?: (value: InputMask<Opts>['value'], maskRef: InputMask<Opts>, e?: InputEvent) => void;
onComplete?: (value: InputMask<Opts>['value'], maskRef: InputMask<Opts>, e?: InputEvent) => void;
} = {}
Expand All @@ -23,7 +24,6 @@ function useIMask<
typedValue: InputMask<Opts>['typedValue'],
setTypedValue: Dispatch<InputMask<Opts>['typedValue']>,
} {
const ref = useRef<MaskElement | null>(null);
const maskRef = useRef<InputMask<Opts> | null>(null);
const [initialized, setInitialized] = useState<boolean>(false);
const [lastAcceptState, setLastAcceptState] = useState<{
Expand Down

0 comments on commit 8b4944f

Please sign in to comment.