Answers for "react router exact"

1

react router exact

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

ReactDOM.render(
  <Router>
    <div>
      <Route exact path="/">
        <Home />
      </Route>
      <Route path="/news">
        <NewsFeed />
      </Route>
    </div>
  </Router>,
  node
);
Posted by: Guest on June-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language