Skip to content
Advertisement

Browser displays TypeError: Cannot read property ‘user’ of undefined

First i do like to apologize if it’s a noob mistake. I’m trying to do a login page but i keep encountering this error. How can i fix this? Thank you all!

Image of Error Code image

JavaScript

As requested i have put the code in the question, i’m sorry i’m new to stack overflow and coding in general. I already tried putting the function initializing the values inside the constant but it just throws another error.

Advertisement

Answer

As I saw at first from your screenshot, that the useState({…}) don’t have appropriate properties. Try like this:

JavaScript

For more details check out this article.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement