Yet another router and a state management lib

I totally understand why people keep looking for new approaches to routing and state management in React. Apparently, these tasks can be solved in multiple ways focusing on different aspects, which is fine. But among the several common solutions (and s…


This content originally appeared on DEV Community and was authored by axtk

I totally understand why people keep looking for new approaches to routing and state management in React. Apparently, these tasks can be solved in multiple ways focusing on different aspects, which is fine. But among the several common solutions (and several less common ones), I can't find a direct approach following the common patterns, which leaves me with the questions at the basickest level:

Can routing be as simple as regular conditional rendering, which route-based rendering essentially is?

Can route-based rendering be the same with components and prop values? Again, like conditional rendering. Unlike having a separate file, a config, or a <Route> component to render an app component based on a route, but going for a route matching hook to render a prop value based on the route.

Do we really need a custom <Link to> component API, while there's an all-familiar HTML <a href> API?

Is it inevitable that local and shared state being conceptually similar things are handled so differently, requiring significant refactors to migrate from one to the other even with the slimmest state management libs?

With these questions having lingered for a while, I came up with a couple of small packages for React apps in an attempt to address these questions and to make a case for the direct approach:

t8.js.org

Along the way I came up with a router for vanilla TS/JS, too.

Let me know what you think of this.


This content originally appeared on DEV Community and was authored by axtk


Print Share Comment Cite Upload Translate Updates
APA

axtk | Sciencx (2025-10-29T16:33:06+00:00) Yet another router and a state management lib. Retrieved from https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/

MLA
" » Yet another router and a state management lib." axtk | Sciencx - Wednesday October 29, 2025, https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/
HARVARD
axtk | Sciencx Wednesday October 29, 2025 » Yet another router and a state management lib., viewed ,<https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/>
VANCOUVER
axtk | Sciencx - » Yet another router and a state management lib. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/
CHICAGO
" » Yet another router and a state management lib." axtk | Sciencx - Accessed . https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/
IEEE
" » Yet another router and a state management lib." axtk | Sciencx [Online]. Available: https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/. [Accessed: ]
rf:citation
» Yet another router and a state management lib | axtk | Sciencx | https://www.scien.cx/2025/10/29/yet-another-router-and-a-state-management-lib/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.