Skip to content
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

fix: useBlocker useEffect infinite loop #10650

Closed
wants to merge 1 commit into from

Conversation

fernandojbf
Copy link

@fernandojbf fernandojbf commented Jun 29, 2023

  • Fix the infinite loop present in useBlocker.
  • Introduces some unit tests to find if the hook breaks the basic functionalities

I believe that will fix remix issue introduced by react-router -> remix-run/remix#6704

Feedback always welcome
(hope the .changeset is correct 😕 😃)

Cheers

@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2023

🦋 Changeset detected

Latest commit: 152fa35

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

This PR includes changesets to release 4 packages
Name Type
react-router Patch
react-router-dom Patch
react-router-dom-v5-compat Patch
react-router-native Patch

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

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Jun 29, 2023

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@brophdawg11
Copy link
Contributor

Thank you for the PR - but I'm afraid we can't use this approach as the solution because useId is only available in React 18, and we support down to React 16.8 at the moment. We can't use 18-only features until we drop support for earlier versions in an eventual major semver release, which is not planned anytime soon.

I think I have an idea of how we can solve this though so I'll try to get a separate PR up once I can validate the approach.

@fernandojbf
Copy link
Author

oh forgot about that. 🤦

The unique incompatible part would be the generation of the id.

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

Successfully merging this pull request may close these issues.

2 participants