[FIX] Uncaught TypeError: Cannot read properties of undefined (reading 'name')
I got this error when working on the login functionality Uncaught TypeError: Cannot read properties of undefined (reading 'name').
It was a particularly frustrating error as there is not a lot of documentation on it however there is a lot of unsolved questions about it on stack overflow and GitHub actions.. Going through the YouTube comments I realise a lit of people had the same issue. so I decided to put the solution here.
[FIX] Uncaught TypeError: Cannot read properties of undefined (reading 'name')
I got this error when working on the login functionality
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
.It was a particularly frustrating error as there is not a lot of documentation on it however there is a lot of unsolved questions about it on stack overflow and GitHub actions.. Going through the YouTube comments I realise a lit of people had the same issue. so I decided to put the solution here.
So this has to do with the userSlice.js file.
The issue is with the exports, the exports are
deleting the user part so that they match their declarations to the reducer as shown below now solves the error