Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofocus not working when state and setState is passed from the parent #441

Open
YashChauhan858 opened this issue Feb 28, 2024 · 0 comments

Comments

@YashChauhan858
Copy link

Auto focus is not working when i passs the state and setState from the parent component but it works when it is internal to the component.

export default function OTP({ setOtp, otp }) {
// const [otp, setOtp] = useState('')

return (
<OtpInput
value={otp}
onChange={setOtp}
numInputs={4}
inputStyle={'otp_input'}
renderSeparator={-}
renderInput={(props) => <input {...props} />}
/>
)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant