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

forceUpdate fix and refactor, alternative to #2982 #2983

Merged
merged 3 commits into from
Jun 20, 2021

Conversation

urugator
Copy link
Collaborator

  1. removed useForceUpdate abstraction
    It was used on single place and impl is trivial.
  2. removed useCallback
    forceUpdate isn't passed anywhere where it could break memoization, therefore no need for useCallback.
    The closure is recreated every render one way or another.
  3. Replace increment with unique reference, see Allows the force update to be infinitely called #2982.
    The choice to use [] is arbitrary. Feel free to change to whatever performs better.

@changeset-bot
Copy link

changeset-bot bot commented Jun 11, 2021

🦋 Changeset detected

Latest commit: f28c7e4

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

This PR includes changesets to release 1 package
Name Type
mobx-react-lite 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

@urugator
Copy link
Collaborator Author

Do I have to do anything in regards to mobx-react (since it depends on lite)? Include in changeset or something?

@urugator urugator merged commit 320544a into mobxjs:main Jun 20, 2021
@github-actions github-actions bot mentioned this pull request Jun 20, 2021
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.

1 participant