"TypeError: Object(...) is not a function" error when trying to use react hooks (alpha)

Viewed 11400

When I try to use the new React hooks feature I run into this annoying error message for some reason.

I followed the instructions on the documentation and upgraded react to the latest alpha version with yarn add react@next.

1 Answers

I actually solved this issue! Most likely what you did to start using hooks was just updated react using yarn add react@next or something similar, but you probably didn't upgrade react-dom which is why you're getting this error.

TLDR; Upgrade react-dom!!

Related