firebase / firebase/functions-samples
Example with nextjs doesn't work with React hooks
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 3.8k
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Description
### How to reproduce these conditions
I have set up an example [repo](https://github.com/Siegrift/nextjs-firebase-example) where you can check the bug.
**Steps to set up and reproduce**
1) `git clone https://github.com/Siegrift/nextjs-firebase-example`
2) `cd src/app`
3) `yarn && yarn dev`
4) navigate to `http://localhost:3000/about`
**You will get:**
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
### Expected behavior
I don't think that this example is valid anymore. I was trying to figure out how to make nextjs work with firebase, but I couldn't figure it out.... Anyway, the expected behaviour is to make it work with nextjs and newest React (e.g. react hooks).
### Actual behavior
Error in application and I am unable to configure nextjs with firebase.
Contributor guide
Assessment
This issue has not been assessed yet.