Declaring routes
We declare the pages in our app using BrowserRouter
, Routes
, and Route
components. BrowserRouter
is the top-level component that performs navigation between pages. Paths to pages are defined in Route
components nested within a Routes
component. The Routes
component decides which Route
component should be rendered for the current browser location.
We are going to start this section by creating blank pages that we'll eventually implement throughout this book. Then, we'll declare these pages in our app using BrowserRouter
, Routes
, and Route
components.
Creating some blank pages
Let's create blank pages for signing in, asking a question, viewing search results, and viewing a question with its answers by carrying out the following steps:
- Create a file called
SignInPage.tsx
with the following content:import React from 'react'; import { Page } from './Page'; export const SignInPage = () => ( Â Â <Page title...