Closed webdiego closed 2 years ago
This is a possible solution:
import dynamic from 'next/dynamic';
const OTPInput = dynamic(() => import('otp-input-react'), { ssr: false });
@webdiego After using your solution I am getting another error:
Property 'value' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'
What's the work-around on this?
<OTPInput value={OTP} onChange={setOTP} autoFocus OTPLength={4} otpType="number" disabled={false} secure />
It could be a typescript error, I'm sorry but I can't help you because I didn't use TS, have u install the types of the library?🤔
I'm also getting this error when using with razzle. Any idea why this is happening?
@webdiego How did you solve this issue?
nvm I solved it by importing it like this:
const { ResendOTP } = dynamic(() => import('otp-input-react'), {ssr: false})
This is a possible solution:
import dynamic from 'next/dynamic';
const OTPInput = dynamic(() => import('otp-input-react'), { ssr: false });
Yes as I said a long time ago :)
I get "window is not defined" with Next.js