FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.5k stars 400 forks source link

use `useSyncExternalStore` to sync data in `useObservable` #583

Closed jhuleatt closed 11 months ago

jhuleatt commented 1 year ago

Description

Migrating the core of ReactFire to useSyncExternalStore, which is the recommended way to sync state between React and something external (in our case RxJS).

The main changes are in src/useObservable.ts and src/SuspenseSubject.ts.

Also adds a test to test/firestore.test.tsx to address #327.