Hello there, I upgraded React and React-DOM to version 16.8.0 to use hooks. I was not using the alpha before.
Whenever I try to use a hook, I get the error Object(...) is not a function.
Here's an example that causes the bug:
import React, { useState } from 'react'
const Component = () => {
const [count, setCount] = useState(0)
return <h1>{count}</h1>
}
I looks similar to the issue #5991.
Please follow the issue template when creating issues. I can't reproduce the issue you're describing based on the provided steps. The provided code runs completely fine for me when I create a new directory, add next react react-dom and then create pages/index.js with your code (and additional export default Component.
Thanks for the quick response.
Turns out I had to restart the Next server to make it work after updating react. I should have investigated more on my own before posting this issue, but hopefully this can help someone.
Most helpful comment
Thanks for the quick response.
Turns out I had to restart the Next server to make it work after updating react. I should have investigated more on my own before posting this issue, but hopefully this can help someone.