Route config

The move from React Router v3 to v4 introduced a declarative, component-based approach to routing - moving away from a static route config. Though there are many benefits to this approach, there are still some benefits to having a central route config. Because React Router is now "just components" and therefore "just javascript", having a central route config with React Router v4 and v5 is still very much possible. The key? Having your routes represented as an array.


Route Config - CodeSandbox

Route Config - CodeSandbox

Copyright 2023 © Borja Leiva

Made within London