onesine / react-tailwindcss-datepicker

Modern date range picker component for React using Tailwind 3 and dayjs. Alternative to Litepie Datepicker.
https://react-tailwindcss-datepicker.vercel.app/
MIT License
552 stars 169 forks source link

[Request Feature]: Not working in React 19 #284

Open VichetN opened 1 month ago

VichetN commented 1 month ago

image

Hope to have this amazing Datepicker compatable with React 19 soon :)

Or if this is a bug, please give me a solution to fix this Error.

roderik commented 1 month ago

Similar error, using nextjs 15, react 19.0.0-rc-65a56d0e-20241020, and react-compiler enabled

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
austingdev commented 4 weeks ago

Similar error for me, using nextjs 15.0.1

Screenshot 2024-10-23 at 10 02 04 AM

Looks like it is linked back to the use of this line:

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Which is stated it should not be used... https://github.com/reactjs/react.dev/issues/3896

carstenblt commented 4 weeks ago

Actually just updating the react dependency works out of the box.

@austingdev The line you mention is not actually part of this package, it just seems to be included when being build with react 18.

austingdev commented 3 weeks ago

@carstenblt you are absolutely correct! I thought I had upgraded to React 19 but it appears I did not.

For those coming here with the same problem, upgrading React to version rc (which ends up being 19) and installing fixed this problem for me.

@VichetN, give the upgrade a try to verify that fixed it for you. If so then closing this issue out would be ideal.

VichetN commented 3 weeks ago

@carstenblt you are absolutely correct! I thought I had upgraded to React 19 but it appears I did not.

For those coming here with the same problem, upgrading React to version rc (which ends up being 19) and installing fixed this problem for me.

@VichetN, give the upgrade a try to verify that fixed it for you. If so then closing this issue out would be ideal.

@austingdev How to upgrade by the way?

Upgrade React of our Nextjs project? should be like this?: yarn add react@19.0.0-rc.0 react-dom@19.0.0-rc.0

Please give me an example

austingdev commented 3 weeks ago

@carstenblt you are absolutely correct! I thought I had upgraded to React 19 but it appears I did not. For those coming here with the same problem, upgrading React to version rc (which ends up being 19) and installing fixed this problem for me. @VichetN, give the upgrade a try to verify that fixed it for you. If so then closing this issue out would be ideal.

@austingdev How to upgrade by the way?

Upgrade React of our Nextjs project? should be like this?: yarn add react@19.0.0-rc.0 react-dom@19.0.0-rc.0

Please give me an example

yes for the NextJS project. You can update the package.json libraries like so:

"react": "rc",
"react-dom": "rc",

then run yarn

VichetN commented 3 weeks ago

@carstenblt you are absolutely correct! I thought I had upgraded to React 19 but it appears I did not. For those coming here with the same problem, upgrading React to version rc (which ends up being 19) and installing fixed this problem for me. @VichetN, give the upgrade a try to verify that fixed it for you. If so then closing this issue out would be ideal.

@austingdev How to upgrade by the way? Upgrade React of our Nextjs project? should be like this?: yarn add react@19.0.0-rc.0 react-dom@19.0.0-rc.0 Please give me an example

yes for the NextJS project. You can update the package.json libraries like so:

"react": "rc",
"react-dom": "rc",

then run yarn

Thank you @austingdev

carstenblt commented 3 weeks ago

Whut, wait? You just changed the version from 19.0.0-rc-69d4b800-20241021 to rc and it worked? So maybe it works with a newer release of react?

I actually had to rebuilt react-tailwindcss-datepicker with react 19 and push it to npm.

austingdev commented 3 weeks ago

Oh I might have had some kind of cacheing issue going on. I thought it was working but I nuked my dist folder and rebuilt and yea, even with rc it is still broken, same error as above.

Does that mean you have pushed a new version that should work with react@rc?

carstenblt commented 3 weeks ago

Oh I might have had some kind of cacheing issue going on. I thought it was working but I nuked my dist folder and rebuilt and yea, even with rc it is still broken, same error as above.

Does that mean you have pushed a new version that should work with react@rc?

Well yes, to @tarabao/react-tailwindcss-datepicker. If you trust that...

mattschutt commented 3 weeks ago

Why is this closed? I do not consider a 3rd party fixing an issue an uploading to a different npm package a fix for the root issue...

Can we get a fix for React 19 RC?

Please reopen until fixed?

austingdev commented 3 weeks ago

@mattschutt I would tend to agree.

@VichetN It should be reopened until release from @onesine is provided and works with React RC.

jaedung commented 1 week ago

Same for me