Created
July 5, 2020 07:39
-
-
Save rehrumesh/8c1f41c1b9f01d093b4178cbfd037aac to your computer and use it in GitHub Desktop.
App.js of Cats application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Router, Route } from "react-router-dom"; | |
import { createBrowserHistory } from "history"; | |
import GreetingCat from "./GreetingCat"; | |
import RandomCat from "./RandomCat"; | |
import "./App.css"; | |
const defaultHistory = createBrowserHistory(); | |
function App({ history = defaultHistory }) { | |
return ( | |
<Router history={history}> | |
<Route exact path="/" component={RandomCat} /> | |
<Route exact path="/cat/:greeting" component={GreetingCat} /> | |
</Router> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment