If you follow the documentation and create a custom header component, the page crashes with the console error message:
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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
at Object.DateFieldCustomHeader [as renderCustomHeader]
This is a duplicate of this issue.
The problem here is, that you defined react and react-dom as a peer dependency, but also as a dev dependency.
Since npm tries to resolve peer depdendencies and only installs them once, this is not necessary.
The dev depdendency causes npm to install react twice if it does not match the peer dependency.
I apologize that i do not provide a pull request, but since you use yarn for your project and i won't like to install yarn to only remove this two lines, i would thank you very much if you just fix this, test it and provide a new version :).
If you follow the documentation and create a custom header component, the page crashes with the console error message:
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:
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
at Object.DateFieldCustomHeader [as renderCustomHeader]
This is a duplicate of this issue.
The problem here is, that you defined react and react-dom as a peer dependency, but also as a dev dependency.
Since npm tries to resolve peer depdendencies and only installs them once, this is not necessary.
The dev depdendency causes npm to install react twice if it does not match the peer dependency.
I apologize that i do not provide a pull request, but since you use yarn for your project and i won't like to install yarn to only remove this two lines, i would thank you very much if you just fix this, test it and provide a new version :).