Skip to content

Add React 19 support #675

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

iwan-uschka
Copy link

This PR adds support for React 19 by fixing TS issues regarding useRef (see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#useref-requires-argument).

Copy link

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: b117e9f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
usehooks-ts Major
www Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@iwan-uschka iwan-uschka changed the title Feature/react 19 support Add react 19 support Feb 7, 2025
@iwan-uschka iwan-uschka changed the title Add react 19 support Add React 19 support Feb 7, 2025
Sorry, copy & paste :/ Thanks!

Co-authored-by: Steffen Holanger <[email protected]>
Copy link

@lachieh lachieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me! Small change on the docs, I'd hear keep both migration pages.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliencrn may disagree, but I think it'd be best to leave this here. The process to go from v2 to v3 doesn't change with this PR and there may be older projects still using v2 that can't get upgrade to react@19 so there's no need to get rid of the docs.

Copy link
Author

@iwan-uschka iwan-uschka Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me. It doesn't do any harm to keep valuable information. @juliencrn any thoughts on this one?

@FezVrasta
Copy link

Any update on this?

@iwan-uschka
Copy link
Author

Any update on this?

Unfortunately not. We have to wait for @juliencrn to have a look at this PR.

@lachieh
Copy link

lachieh commented Feb 27, 2025

At this point, given the lack of response from @juliencrn, I'm going to make the recommendation to switch to streamich/react-use. There's an equivalent replacement for almost all of the hooks in this library, it is built on TypeScript, and includes a lot more hooks (33 here vs 90 in react-use).

https://npmtrends.com/@uidotdev/usehooks-vs-react-use-vs-usehooks-ts

@minecrawler
Copy link

At this point, given the lack of response from @juliencrn, I'm going to make the recommendation to switch to streamich/react-use. There's an equivalent replacement for almost all of the hooks in this library, it is built on TypeScript, and includes a lot more hooks (33 here vs 90 in react-use).

https://npmtrends.com/@uidotdev/usehooks-vs-react-use-vs-usehooks-ts

After researching it, react-use also seems dead. It gets minuscule updates every few months even though it has hundreds of open PRs and even more open issues. There's even a successor project because all maintainers jumped board at one point and the last one created a new project which does the same thing as react-use... btw, that successor project is also going pretty slowly. It feels like the entire space of use-hook libraries is kind of a mess, and in dire need of passion and maybe a corporate sponsor.

@JonnyDawe
Copy link

JonnyDawe commented Apr 1, 2025

At this point, given the lack of response from @juliencrn, I'm going to make the recommendation to switch to streamich/react-use. There's an equivalent replacement for almost all of the hooks in this library, it is built on TypeScript, and includes a lot more hooks (33 here vs 90 in react-use).
https://npmtrends.com/@uidotdev/usehooks-vs-react-use-vs-usehooks-ts

After researching it, react-use also seems dead. It gets minuscule updates every few months even though it has hundreds of open PRs and even more open issues. There's even a successor project because all maintainers jumped board at one point and the last one created a new project which does the same thing as react-use... btw, that successor project is also going pretty slowly. It feels like the entire space of use-hook libraries is kind of a mess, and in dire need of passion and maybe a corporate sponsor.

I've been porting over to using many of the hooks from the Mantine library. They are their own separate package but clearly form part of the wider library code, and therefore are actively being maintained. Its not a complete drop in replacement, but seems to be very well executed.

@songzhj
Copy link

songzhj commented Apr 7, 2025

Any update❓

@lachieh
Copy link

lachieh commented Apr 8, 2025

Use @mantine/hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants