I totally understand why people keep looking for new approaches to routing and state management in React. These tasks can indeed be solved in multiple ways by focusing on different aspects. 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 most basic level:
Can routing be as simple as regular conditional rendering, which route-based rendering essentially is?
Can route-based rendering work the same way 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:
Website: t8.js.org
GitHub: t8js
Along the way I came up with a router for vanilla TS/JS, too.
Let me know what you think of this.
Top comments (0)