Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
al-m26796y@elwd https://github.com/Al-Names/...
it all works fine till i try to go to the create route, be it user or group then it crashes. its a redux thing I’m not sure why -
elwd456yDefining the dynamic routes after the nondynamic routes seemed to fix it. Don’t know why this is. If there is a problem somewhere else or if its a bug in react-router. Eg switch line 30 and 31 in app.js fixed the users/create route. A groups/create component doesn’t exist.
Why did i even try doing that? Going to the route for create user falled me back to user/:name without any context so figured it tried to reroute me to closest.
Sorry if your not getting a clear explanation but that will fix the current error atleast. -
@elwd @al-m
React tries to open the view for a user named 'create'.
That's because the route /users/:name also matches for '/users/create', it binds the :name path-variable to 'create'.
Reordering helps, because that way the more specific routed is tested first.
This also means, that you can't have a user named 'create'. -
elwd456y@succcubbus yeah realized that was the case afterwards.
The project structure was great, found everything i needed with ease.
Some things didn’t align correctly but otherwise it looked good but empty since there wasn’t any content :)
Related Rants
Anyone free and willing to help me with a react code review?
I’m stuck somewhere and not sure where i went wrong
rant
react
redux
review
help