install npm react-router-dom code example

Example 1: npm react router dom

$ npm install --save react-router-dom

Example 2: installing react router dom in npm

yarn add react-router-dom

Example 3: npm react router dom

// using ES6 modulesimport { BrowserRouter, Route, Link } from "react-router-dom"; // using CommonJS modulesconst BrowserRouter = require("react-router-dom").BrowserRouter;const Route = require("react-router-dom").Route;const Link = require("react-router-dom").Link;

Example 4: npm react router dom

<script src="https://unpkg.com/react-router-dom/umd/react-router-dom.min.js"></script>