Skip to content

Commit

Permalink
Add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik committed Jul 23, 2024
1 parent 5982384 commit 5759bd1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/realm-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
* None

### Enhancements
* Added `useProgress` hook which provides a convenient way to access Realm's progress information. It works in a similar way as `realm.addProgressNotification`. **Note: this feature is only intended for flexible sync with the new estimate-based progress notifications.** ([#6797](https://github.com/realm/realm-js/issues/6797))
```tsx
import { RealmProvider, ProgressDirection, ProgressMode } from "@realm/react";

const ProgressText = () => {
const progress = useProgress({ direction: ProgressDirection.Download, mode: ProgressMode.ReportIndefinitely });

return <Text>Loading: {progress}/1.0 Downloaded</Text>;
}

const MyApp() = () => {
return (
<RealmProvider sync={...}>
<ProgressText />
</RealmProvider>
);
}
```
* Added the ability to get `progress` information in `fallback` component of `RealmProvider` when opening a synced Realm. ([#6785](https://github.com/realm/realm-js/issues/6785))
```tsx
import { RealmProvider, RealmProviderFallback } from "@realm/react";
Expand Down

0 comments on commit 5759bd1

Please sign in to comment.