UNPKG

749 B Markdown View Raw
1---
2title: Installation
3order: 1
4---
5
6# Installation
7
8[MODES: declarative]
9
10## Introduction
11
12You can start with a React template from Vite and choose "React", otherwise bootstrap your application however you prefer.
13
14```shellscript nonumber
15npx create-vite@latest
16```
17
18Next install React Router from npm:
19
20```shellscript nonumber
21npm i react-router
22```
23
24Finally, render a `<BrowserRouter>` around your application:
25
26```tsx lines=[3,9-11]
27import React from "react";
28import ReactDOM from "react-dom/client";
29import { BrowserRouter } from "react-router";
30import App from "./app";
31
32const root = document.getElementById("root");
33
34ReactDOM.createRoot(root).render(
35 <BrowserRouter>
36 <App />
37 </BrowserRouter>,
38);
39```
40
41---
42
43Next: [Routing](./routing)
44
\No newline at end of file