FirebaseExtended / reactfire

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

Error: SDK not found. useSdk must be called from within a provider #455

Closed bk973 closed 2 years ago

bk973 commented 2 years ago

When I add useAuth(), my app crushes with Error: SDK not found. useSdk must be called from within a provider Sorry, am new to this library and I followed the DOCS while setting up auth stuff but I don't understand that error. I followed everything in the DOCS carefully

jhuleatt commented 2 years ago

Hi @bk973, you'll need to add an AuthProvider component as a parent of the component that's calling useAuth. Here's a sample.

bk973 commented 2 years ago

Thank you so much @jhuleatt Your suggestion has been helpful