Skip to content

Instantly share code, notes, and snippets.

View sumitdey851's full-sized avatar
🎯
Focusing

Sumit Dey sumitdey851

🎯
Focusing
View GitHub Profile
@sumitdey851
sumitdey851 / basic_router.jsx
Created September 7, 2021 05:34 — forked from siakaramalegos/basic_router.jsx
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';