prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

fix(docs): add the required database import to use realtime database to examples #1080

Closed danielo515 closed 3 years ago

danielo515 commented 3 years ago

Do you want to request a feature or report a bug?

The current getting started is missing key information to start using this cool library. I think the most use case scenario is with the real time database, which this library seems to support out of the box (no extra deps). However, I can't find a single reference nowhere in the docs about setting up the real time database, only firestore. This can lead to very frustrating experiences because the first time you try to load data from the database you will find the following error:

Error: Firebase database is required to create watchers

What is the current behavior?

The current docs have commented code about firestore, but it doesn't contain a single reference to the requirement of importing the real time database, which is a must. It is as simple as adding import 'firebase/database' to the getting started example

What is the expected behavior?

To have a commented line telling you that you must import the real time database if you want to use it.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

prescottprue commented 3 years ago

Thanks for calling this out! Definitely the case, and we want to make things as easy as possible when setting up

Pushed up a change to include