Realm React v0.10.0
github-actions
released this
15 Aug 17:44
·
34 commits
to main
since this release
Enhancements
- Added
useProgress
hook which provides a convenient way to access Realm's progress information. It works in a similar way asrealm.addProgressNotification
. (#6797)
import { RealmProvider, ProgressDirection, ProgressMode } from "@realm/react";
const ProgressText = () => {
const progress = useProgress({ direction: ProgressDirection.Download, mode: ProgressMode.ReportIndefinitely });
return <Text>Loading: {(100 * progress).toFixed()}%</Text>;
}
const MyApp() = () => {
return (
<RealmProvider sync={...}>
<ProgressText />
</RealmProvider>
);
}
- Added the ability to get
progress
information infallback
component ofRealmProvider
when opening a synced Realm. (#6785)
import { RealmProvider, RealmProviderFallback } from "@realm/react";
const Fallback: RealmProviderFallback = ({ progress }) => {
return <Text>Loading:{(100 * progress).toFixed()}%</Text>;
}
const MyApp() = () => {
return (
<RealmProvider sync={...} fallback={Fallback}>
...
</RealmProvider>
);
}
Compatibility
- Realm JavaScript >= v12.12.0.
- React Native >= v0.71.4
- Realm Studio v15.0.0.
- File format: generates Realms with format v24 (reads and upgrades file format v10).