Closed patilkrunal closed 2 years ago
Even adding e.preventDefault it refreshes the page in otp-input-react:v0.2.0 as 0.2.2 had some issues. this is my resendOTP function:
const sendOTP = (e) => { e.preventDefault(); requestOTP({ mobile_no: mobile_no }); console.log("resend otp clicked"); }; <ResendOTP className="mb-4 mt-2" maxTime="30" onResendClick={(e) => sendOTP(e)} />
Console output is: Uncaught TypeError: e.preventDefault is not a function The button in ResendOTP doesnt have type="button" attribute. Might be because of this. not sure. Its not able to recognize event. How do I solve this issue.
Uncaught TypeError: e.preventDefault is not a function
Fixed
Even adding e.preventDefault it refreshes the page in otp-input-react:v0.2.0 as 0.2.2 had some issues. this is my resendOTP function:
Console output is:
Uncaught TypeError: e.preventDefault is not a function
The button in ResendOTP doesnt have type="button" attribute. Might be because of this. not sure. Its not able to recognize event. How do I solve this issue.