Before routing
HTML url links were used to navigate between pages in much older monolithic applications. Each page triggered a page reload which ment the server had render every page separately. Updating or scaling these applications required changing the entire codebase as one large unit. In new applications design with filing systems that proper the code so it can be updated by everybody. This makes it easier for multiple developers to work on the same codebase at once. This method of working is know as micro-servicing.
Routing in react
React is a javascript library developed by Meta formally know as Facebook inc. React-router is the preferred method of navigation between different pages. React does not include routing by default when create-react-app is started. There are a few option for routing in react:
Single-page apps (SPA)
Streaming Server-side rendering (SSR) No components
Static site generation (SSG) Nested routes, links and classes
React Server Components (RSC)
Alternatives to React Routing
In other popular javascript frameworks like Next.js routing is preformed differently. In Vue.js routing is expensive, configurable upon starting a new npm create vue@latest project as option. Choosing to install Vue Router will enable some core features to handle routing.
Conciliation
Top comments (0)