Blog
0.email frontend is built using react-router framework.

0.email frontend is built using react-router framework.

In this article, we will review how 0.email frontend is built using react-router framework. We will look at:

  1. react-router in package.json

  2. What is react-router?

react-router in package.json

I found that 0.email uses react-router framework by looking at its scripts objects in package.json file.

{
  "name": "@zero/mail",
  "version": "0.1.0",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "react-router dev",
    "build": "react-router build",
    "start": "wrangler dev --port 3000 --show-interactive-dev-session=false",
    "types": "wrangler types",
    "deploy": "wrangler deploy",
    "lint": "eslint ."
  },

As you can there is dev and build scripts in the above code snippets using react-router.

What is react-router?

React-router is a multi-strategy router for React bridging the gap from React 18 to React 19. You can use it maximally as a React framework or as minimally as you want.

You can learn more about react-router

Picking a mode

React Router is a multi-strategy router for React. There are three primary ways, or “modes”, to use it in your app. Across the docs you’ll see these icons indicating which mode the content is relevant to:

  1. Framework

  2. Data

  3. Declarative

Learn more about picking a mode

When you choose framework as your mode, you can create a project using the command below:

npx create-react-router@latest my-react-router-app

Now change into the new directory and start the app

cd my-react-router-app
npm i
npm run dev

You can now open your browser to http://localhost:5173

You can learn more about framework-mode

About me

Hey, my name is Ramu Narasinga. I study codebase architecture in large open-source projects.

Email: [email protected]

Build Shadcn CLI from scratch.

References:

  1. https://reactrouter.com/start/framework/installation

  2. https://github.com/Mail-0/Zero/blob/staging/apps/mail/package.json#L7

  3. https://reactrouter.com/home#getting-started

  4. https://reactrouter.com/start/modes#picking-a-mode

  5. https://reactrouter.com/start/framework/routing