Skip to content

Commit

Permalink
chore(input): remove unused dep for onChange useCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermerodz committed Mar 7, 2024
1 parent 4a71419 commit f5ce1db
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/input-otp/src/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,10 @@ export const OTPInput = React.forwardRef<HTMLInputElement, OTPInputProps>(
const previousValue = usePrevious(value)
const onChange = React.useCallback(
(newValue: string) => {
// Check if input is controlled
if (uncheckedValue !== undefined) {
uncheckedOnChange?.(newValue)
} else {
setInternalValue(newValue)
uncheckedOnChange?.(newValue)
}
uncheckedOnChange?.(newValue)
setInternalValue(newValue)
},
[uncheckedOnChange, uncheckedValue],
[uncheckedOnChange],
)
const regexp = React.useMemo(
() =>
Expand Down

0 comments on commit f5ce1db

Please sign in to comment.