Setting Up Your Portfolio Website with React Router

What is React Router?

Initial Set Up

npx create-react-app my-portfolio
npm install react-router-dom

Import Necessary Components

import React from 'react';
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";

Enclose Everything in Router

Add in Navigation with Corresponding Links

Adding in Switch

Adding in Routes and Other Components

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
thequeenbeebs

thequeenbeebs

14 Followers

Blaire is a musical theatre performer who also moonlights as a full-stack software engineer. https://www.linkedin.com/in/blaire-baker