diff --git a/src/lib/AutoNumericComponent.tsx b/src/lib/AutoNumericComponent.tsx index 59dcde3..009e5fd 100644 --- a/src/lib/AutoNumericComponent.tsx +++ b/src/lib/AutoNumericComponent.tsx @@ -46,11 +46,11 @@ export default function AutoNumericComponent({ autoNumericOptions, state, }: { - element: string; - refKey: string; - props?: Parameters[1]; - autoNumericOptions?: CallbackOptions; - state?: NonNullable[1]>; + element: Readonly; + refKey: Readonly; + props?: Readonly[1]>; + autoNumericOptions?: Readonly; + state?: Readonly[1]>>; }): JSX.Element { const htmlElement = useRef(null); const autoNumeric = useRef(null); @@ -78,7 +78,7 @@ export default function AutoNumericComponent({ htmlElement.current, autoNumericOptions ?? {}, ); - }, [htmlElement.current, autoNumericOptions]); + }, [htmlElement.current]); if (state !== undefined) { useEffect(() => { diff --git a/src/lib/AutoNumericInput.tsx b/src/lib/AutoNumericInput.tsx index b4b1e04..e9d0200 100644 --- a/src/lib/AutoNumericInput.tsx +++ b/src/lib/AutoNumericInput.tsx @@ -33,7 +33,8 @@ export type InputProps = Omit< * JSX!IntrinsicElements.input.props}. * @param options.autoNumericOptions - Options passed to {@link !AutoNumeric}. Same as {@link * AutoNumeric!Options}. - * @param options.valueState - The state and state setter from the parent component. + * @param options.valueState - The state and state setter from the parent component to be passed + * into this component. * @param options.valueState.state - The state from the parent component to be passed in. * @param options.valueState.stateSetter - The callback function that sets * `options.valueState.state`. @@ -44,10 +45,10 @@ export function AutoNumericInput({ autoNumericOptions, valueState, }: { - inputProps?: InputProps; - autoNumericOptions?: CallbackOptions; + inputProps?: Readonly; + autoNumericOptions?: Readonly; valueState?: { - state: string; + state: Readonly; stateSetter: React.Dispatch>; }; }): JSX.Element {