Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: LJ <81748770+elle-j@users.noreply.github.com>
  • Loading branch information
takameyer and elle-j committed Aug 23, 2023
1 parent 35bdf9e commit 3adbb74
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/realm-react/CHANGELOG.md
Expand Up @@ -4,7 +4,7 @@
* None

### Enhancements
* Add flag to keep realm open on unmount of RealmProvider. ([#6023](https://github.com/realm/realm-js/issues/6023))
* Add flag to keep realm open on unmount of `RealmProvider`. ([#6023](https://github.com/realm/realm-js/issues/6023))

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
Expand Down
2 changes: 1 addition & 1 deletion packages/realm-react/README.md
Expand Up @@ -235,7 +235,7 @@ const AppWrapper = () => {
}
```

It may also be necessary to render multiple `RealmProvider`s of the same Realm in an app. In this case, the flag `closeOnUnmount` can be set to `false`` to prevent both Realm instances from closing when one has been removed from the component tree.
It may also be necessary to render multiple `RealmProvider`s of the same Realm in an app. In this case, the flag `closeOnUnmount` can be set to `false`` to prevent both Realm instances from closing when one has been removed from the component tree.
This is set to `true` by default.

```tsx
Expand Down
1 change: 0 additions & 1 deletion packages/realm-react/src/__tests__/RealmProvider.test.tsx
Expand Up @@ -75,7 +75,6 @@ describe("RealmProvider", () => {
const { result, unmount } = renderHook(() => useRealm(), { wrapper });
await waitFor(() => expect(result.current).not.toBe(null));
const realm = result.current;
expect(realm).not.toBe(null);
expect(realm.schema[0].name).toBe("dog");
unmount();
expect(realm.isClosed).toBe(false);
Expand Down

0 comments on commit 3adbb74

Please sign in to comment.