Hacker News new | ask | show | jobs
by geocar 3222 days ago
It's also less capable and completely incompatible with router 3.
1 comments

I hadn't heard that it was less capable. But you can always keep using v3 if that's what you know. He seemed to indicate that it took him a week to figure out routing in React. I have never had that much trouble.
> He seemed to indicate that it took him a week to figure out routing in React. I have never had that much trouble.

When you haven't had "that much trouble", it sounds like you're calling them stupid or a liar, and it sounds like you didn't consider the possibility that you're working on a very different problem or have a different definition of "figure out routing".

I store all of my user state in the URL. This way users can copy URLs to each other containing their state, I can press reload to debug things, Other people can embed portions of my application into iframes, and other good benefits.

However I don't want to sprinkle url changes and parsers all over my code, so I'd like to hook into the router system and glue it into the property system. I've probably been through a few versions of this idea with react and certainly spent at least a week in total trying to get it working well with all the different browsers and widgets, only to have react-router 4 come out and break it.

I then probably spent at least a day or two looking for similar-shaped hooks and couldn't find them. Maybe I should have spent more, maybe I should've been smarter.

However I note that the author of React-router took four very different approaches towards figuring out routing and produced incompatible APIs, which is a strong sign that they weren't able to figure out how routing should work either.

No, it's simply that OP did not clarify with any specific problem he had with React Router.

If React Router is not suiting your needs, there are many other options out there. That's the beauty of the ecosystem:

https://github.com/FormidableLabs/redux-little-router https://github.com/react-community/react-navigation

I'm glad that even React Router was willing to iterate on its implementation.

It takes a couple of hours to do a bit of research and searching to find the solution that fits your needs best.

Is there are reason you're not considering angular?

I feel like I'm missing something big with everyone not even talking about angular. Maybe I feel this because Angular was big and then soon it wasn't. Probably that's the disconnect

Same here, This all seems like a "My JS Lib is better than your JS Lib" fight. So let me say this, React is by far and away the best JS view library out there. I don't need MVC in my fucking view(Hey Ember), and I don't need a entire framework for my view(Hey Angular)..

ReactJS 4tw.