Open bhojkamal opened 2 years ago
Hello, I converted component to element In Routes.js. That was solved, Now after login, I got this error
From this error, are you sure that when you registered the /user/login endpoint in the react router dom, you also added the right component (LoginComponent)?
On Fri, Jun 17, 2022 at 10:51 AM BhojKamal @.***> wrote:
Hello, I followed your article from medium.com and setup on my local. I used the latest version for mui, react.js. Got some problems but most of them. Now could not login.
cause some error on routers [image: image] https://user-images.githubusercontent.com/14083299/174274423-d3f0f566-12fc-4c16-b1d0-fe89362835f2.png
Can you help? Thanks.
— Reply to this email directly, view it on GitHub https://github.com/jmkolawole/laravel-react-fullstack-application-with-passport-redux-and-material-ui/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALSX7QTIVURSYV3VGXVVPQTVPRDAZANCNFSM5ZBXM7KQ . You are receiving this because you are subscribed to this thread.Message ID: <jmkolawole/laravel-react-fullstack-application-with-passport-redux-and-material-ui/issues/1 @github.com>
From this error, are you sure that when you registered the /user/login endpoint in the react router dom, you also added the right component (LoginComponent)? … On Fri, Jun 17, 2022 at 10:51 AM BhojKamal @.***> wrote: Hello, I followed your article from medium.com and setup on my local. I used the latest version for mui, react.js. Got some problems but most of them. Now could not login. cause some error on routers [image: image] https://user-images.githubusercontent.com/14083299/174274423-d3f0f566-12fc-4c16-b1d0-fe89362835f2.png Can you help? Thanks. — Reply to this email directly, view it on GitHub <#1>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALSX7QTIVURSYV3VGXVVPQTVPRDAZANCNFSM5ZBXM7KQ . You are receiving this because you are subscribed to this thread.Message ID: <jmkolawole/laravel-react-fullstack-application-with-passport-redux-and-material-ui/issues/1 @github.com>
This was solved by converting the component to element. Now after login, I got above error, I just added above.
Now, everything else is working apart from after login successfully and redirect to /user, that throws above error. If I change to url /home is working without any error or warning. /user/login, /user/register, all worked. I've changed here due to error. This need to change on this line of code on Routes.js
{/*Redirect if not authenticated */}
<Route path="/user" token="user-token" routeNavigate="/user/login" element={[<Guard />, <PrivateRoute />]} />
In your original code, it was
<Guard path="/user" token="user-token" routeRedirect="/user/login" component={PrivateRoute}/>
If put Guard in place of Route, it does not work. and component need to change element and inside in jsx.
How can we solve this?
Thanks.
Does it work with component?
Seems you can only access the path property when you use component
On Fri, Jun 17, 2022, 11:47 AM BhojKamal @.***> wrote:
Hello, I converted component to element In Routes.js. That was solved, Now after login, I got this error
[image: image] https://user-images.githubusercontent.com/14083299/174283948-852da116-b09f-41c6-9271-1c8b8e4a9e97.png
— Reply to this email directly, view it on GitHub https://github.com/jmkolawole/laravel-react-fullstack-application-with-passport-redux-and-material-ui/issues/1#issuecomment-1158748961, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALSX7QXJ5ZQU5KUFR6W76DDVPRJVJANCNFSM5ZBXM7KQ . You are receiving this because you commented.Message ID: <jmkolawole/laravel-react-fullstack-application-with-passport-redux-and-material-ui/issues/1/1158748961 @github.com>
It does not work with component in latest version of React or Redux. It needs to be element = { compenent in jsx }.
I've put my repo here with my changes to adopt latest version of react, redux, react-dom and mui for the same project.
https://github.com/bhojkamal/laravel-react-app-with-passport-redux-and-material-ui
It is on latest version till date.
I'm new to React.js project. So, I could not fix this one.
Hello, I followed your article from medium.com and setup on my local. I used the latest version for mui, react.js. Got some problems but solved most of them. Now could not login.
cause some error on routers
Can you help? Thanks.