FirebaseExtended / reactfire

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

docs: Mention experimental build of React #403

Closed banyan closed 3 years ago

banyan commented 3 years ago

Ref: https://github.com/FirebaseExtended/reactfire/discussions/349

Description

reactfire originally needed an experimental build of react, but in this commit, the reference has gone. Do we still need an experimental build of react to use concurrent mode in reactfire? Or does stable react work fine? The createRoot API does not exist in stable of react 17, so if this pull request is not correct, I think it needs to be mentioned like in the past.

Edit: perhaps, my PR is not correct, however, I want to clarify anyway.

jhuleatt commented 3 years ago

Hi @banyan, thanks for the question and PR. The normal quickstart does indeed just use ReactDOM.render.

However, for the concurrent mode quickstart to use concurrent mode features, an experimental build of React is required, along with unstable_createRoot instead of render.

It looks like the concurrent mode quickstart is a little out of date. Would you be open to updating it? It would involve:

  1. Adding react@experimental and react-dom@experimental to step 3, with a link to the concurrent mode docs for explanation
  2. Changing ReactDOM.createRoot to ReactDOM.unstable_createRoot
banyan commented 3 years ago

@jhuleatt

Thanks for the clarification! I've updated the document.

jhuleatt commented 3 years ago

🥇 Thank you for making the ReactFire docs better @banyan!