1
al-m
6y

Anyone free and willing to help me with a react code review?

I’m stuck somewhere and not sure where i went wrong

Comments
  • 3
    Don't ask to ask. There are always helpers around here
  • 0
  • 1
    Post the github link and describe your problem and ill have a try
  • 0
    @elwd thank you!!! I’ll do that ASAP
  • 0
    @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
  • 0
    Defining 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.
  • 0
    @elwd that’s so strange never heard that rule before.
  • 0
    @elwd what did you think of the aesthetics btw?
  • 3
    @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'.
  • 1
    I don't know react but the structure of your files looks so good.
  • 1
    @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 :)
  • 0
    @SoulSkrix ayyy honestly that’s the thing I’m most trash at
Add Comment