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

Make useObject compatible with undefined objects #6115

Merged
merged 5 commits into from
Sep 4, 2023

Conversation

takameyer
Copy link
Contributor

@takameyer takameyer commented Sep 1, 2023

What, How & Why?

  • If somehow an object returns undefined, re-renders would be skipped
  • Added tests for proving that re-renders occur when the database is cleared
  • Removed 11.0.0-rc from peer-dependency

This closes #6101

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 💥 Breaking label has been applied or is not necessary

* If somehow an object returns undefined, re-renders would be skipped
* Added tests for proving that re-renders occur when the database is cleared
* Removed 11.0.0-rc from peer-dependency
Copy link
Contributor

@elle-j elle-j left a comment

Choose a reason for hiding this comment

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

LGTM 🙂

packages/realm-react/src/useObject.tsx Outdated Show resolved Hide resolved
@takameyer takameyer merged commit ca1d2b9 into main Sep 4, 2023
25 of 32 checks passed
@takameyer takameyer deleted the andrew/rr/fix-undefined-useObject branch September 4, 2023 08:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The useObject doesn't re-render when the value transitions from undefined to an object.
3 participants