Ask HN: Is redux-little-router the best router option to use with redux?

2 points by johnmw ↗ HN
Hi HN,

I'm comfortable with basic Javascript but I am new to the larger npm ecosystem. I have been suffering 'Javascript fatigue' working out what libraries and technologies to use.

In the end I chose the React path.

I found 'create-react-app' a great way to get started that initially hides much of the tooling complexity from you. [1]

I found 'redux' a fantastic way to manage state. [2]

But things became less clear when it came to routing. The first options I could see were:

1. Roll your own. However routing is such a common requirement I'd much rather find a library than reinvent the wheel and deal with things like cross browser issues myself.

2. Use react-router [3]. This appears to be the standard React routing solution and I was going to use this initially.

But then I saw the negative reaction to react-router version 4. It seems there is still quite a bit of churn going on with this library.

Secondly I saw a post [4] that react-router is not the best solution if you use redux and that a more suitable library exists called react-little-router [5].

The argument is pretty convincing and it seems react-little-router is the way to go? But it is a lot less popular.

I'm hoping some of those who are more experienced in React and Redux than me will weigh in with some thoughts and advice.

Thanks in advance.

[1] https://github.com/facebookincubator/create-react-app

[2] http://redux.js.org/

[3] https://github.com/ReactTraining/react-router

[4] https://formidable.com/blog/2016/07/11/let-the-url-do-the-talking-part-1-the-pain-of-react-router-in-redux/

[5] https://github.com/FormidableLabs/redux-little-router

1 comment

[ 3.0 ms ] story [ 32.2 ms ] thread
React-Router is certainly the most widely used option, and the v4 "just components" API _may_ make it work nicer with Redux. Dan Abramov certainly seems to like the direction the API is taking.

That said, there's definitely other options. I keep a list of Redux-related addons and utilities, and have a page listing Redux+routing libs: https://github.com/markerikson/redux-ecosystem-links/blob/ma... .

I've never actually done any client-side routing in my own apps, so that's just a list of stuff I've found and categorized, but hopefully it's useful for you.

You may also be interested in my list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Tons of useful info linked from there.