-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 19 Support #1235
Comments
For anyone interested in bringing this project up-to-date for React 19, I've started a fork that keeps the original https://github.com/ChrisCrossCrash/react-chartjs-3/tree/original-source-code The linked tag has exactly the same source code as react-chartjs-2, with a slightly different Prettier configuration. It still does not build, but I could not get the original project to build either. To the maintainers of react-chartjs-2, if you are interested, I will make a PR if I can get it to work. Since it's been over a year since the last commit, I'm just running with the assumption that this project has been abandoned. In any case, thank you for all the hard work you've put into this repository! |
@ChrisCrossCrash I made the tests pass in #1236, I think it builds alright but complains about types |
@ChrisCrossCrash what issues does this project actually have with React 19? I had a look at the source code, and it seems fine. A bump in peer deps version might be sufficient and perhaps modifying some of the types. |
@imjordanxd Seems to work fine for me after upgrading to React 19, but I do get errors when running type-check on my project:
Probably related to https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript? |
After fixing the JSX.Element to import from react, there is still one type failure:
|
I managed to fix the types in #1236 So it passes the tests with react 19. |
@imjordanxd Sorry for not getting back to you sooner. I was on vacation last week. I'm not aware of any runtime issues with React 19, but I wasn't really interested in getting it working without properly sorting fixing some of the type issues that prevented it from building correctly. Also, a lot of the tooling for the repository is quite outdated. For example, it requires an old version of PNPM to install everything if you want to use the lock file. That's why I thought it would be easier to start by just copying the |
Nice @anajavi! Hopefully it will get merged soon! If not, and you or anybody else is interested in maintaining a fork of this repo, I think that would be great!
Just saw this too! That's awesome! A user named @pieterbergwerff made a pull request on my fork that also fixes the TypeScript build errors. It might be worth checking out if you want to see an alternate approach. I'm not planning on maintaining that fork. I'm just throwing it out there in case you would like to see those changes. |
Would you like to work on this feature?
What problem are you trying to solve?
When I try to install React 19 in my project, I get this warning:
Describe the solution you'd like
I would like
react-chartjs-2
to support React 19 as a peer dependency.Describe alternatives you've considered
None.
Documentation, Adoption, Migration Strategy
If React 19 can be added as a peer dependency, users should be able to install
react-chartjs-2
in a React 19 project without a warning.The text was updated successfully, but these errors were encountered: