You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
i am trying to use ref to setvalue but its giving null. otpInputRef.current its giving null
Expected behavior
can use ref to setvalue
Environment (please complete the following information):
now i defined this modal inside the main component .
this is how it shows and if if i try to access its showing null
console.log("this.otpRef.current", this.otpRef)
console.log( this.otpRef.current)
From the first sight, it makes me think that the issue is in the initialization time of the component. As the modal is not rendered straight away on the screen, setting reference skips first renders. So it becomes available in the later renders
Describe the bug
A clear and concise description of what the bug is.
i am trying to use ref to setvalue but its giving null. otpInputRef.current its giving null
Expected behavior
can use ref to setvalue
Environment (please complete the following information):
Code `
const OTPVerificationModal =forwardRef((props, ref) => {
const { showOtpVerificationModal, hideOtpVerificationModal, onChangeTextOtp, onSubmitOtp }=props;
const otpInputRef = useRef(null); // Explicitly type the ref
})
`
The text was updated successfully, but these errors were encountered: