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

#2527 Consolidate behavior of React.forwardRef & observer #3282

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

urugator
Copy link
Collaborator

@urugator urugator commented Feb 3, 2022

Solves #2527, #3267

mobx-react-lite

Added support for observable(forwardRef(fn))
Deprecated observable(fn, { forwardRef: true }) - prints warning on devel.
observer(memo(fn)) now throws (previously only mobx-react's observer was throwing)

mobx-react

observer(forwardRef(fn)) delegates to mobx-react-lite, it no longer generates extra <Observer> element and it applies memo correctly (previously these were not memoized)

I would appreciate if someone could check if typing is correct.

@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2022

🦋 Changeset detected

Latest commit: daaad14

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

This PR includes changesets to release 2 packages
Name Type
mobx-react Minor
mobx-react-lite 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

@urugator urugator changed the title #2527 Consolidate behavior of React.forwardRef & observe #2527 Consolidate behavior of React.forwardRef & observer Feb 3, 2022
@urugator urugator merged commit 59b42c2 into mobxjs:main Feb 11, 2022
@github-actions github-actions bot mentioned this pull request Feb 11, 2022
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