react-datepicker
react-datepicker copied to clipboard
Error when rendering <DatePicker />, invalid hook call.
Describe the bug When using the DatePicker, an error is returned saying:
Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. React
To Reproduce Steps to reproduce the behavior:
- Create a new react app, and import react-datepicker
- Create a form
Expected behavior On load, the screen will be white and the console log will show the error.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
I'm getting the same error
Also getting this error. Running on Next.js / Typescript.
Same error here! any solutions ?
Same problem here, using React 17.0.1
Is there any update this issue?