A minimalistic routing approach for React.js apps
There are many cases when you don't need a fully featured routing and navigation approach, and using something similar to this will do the trick with routing, navigation and async data fetching just fine:
3.4K+ developers have started their personal blogs on Hashnode in the last one month.
Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more
This looks pretty simple and straightforward. I personally feel solutions like react-router, react-router-component etc are a little complex for beginners. Why do you think react-routing is minimalistic? What are the features that it lacks when compared to react-router?
The code sample above demonstrates how to implement a basic routing without using any 3rd party libraries.
And in regards to the
react-routing library.. it has this concept of a routing table (basically an array) where each route is just a URL path and one or more actions (route handlers) associated with it. Inside a route handler function you're free to do whatever you want, e.g. print to the console, fire up some actions on a worker process, asynchronously fetch some data, render React component etc. (it has no dependency on React and is extremely flexible I believe ).