Commit 67d14d5d authored by imtiny's avatar imtiny

add basic route and simple home page

parent 397414c8
import React from 'react'; import React from 'react';
import logo from './logo.svg';
import { Counter } from './features/counter/Counter';
import './App.css'; import './App.css';
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Home from './pages/Home';
const NotFound = () => {
return (
<div>
<h1>Notfound page</h1>
</div>
)
}
function App() { function App() {
return ( return (
<div className="App"> <Router>
<header className="App-header"> <div>
<img src={logo} className="App-logo" alt="logo" /> <Switch>
<Counter /> <Route exact path='/' component={Home} />
<p> <Route component={NotFound} />
Edit <code>src/App.tsx</code> and save to reload. </Switch>
</p>
<span>
<span>Learn </span>
<a
className="App-link"
href="https://reactjs.org/"
target="_blank"
rel="noopener noreferrer"
>
React
</a>
<span>, </span>
<a
className="App-link"
href="https://redux.js.org/"
target="_blank"
rel="noopener noreferrer"
>
Redux
</a>
<span>, </span>
<a
className="App-link"
href="https://redux-toolkit.js.org/"
target="_blank"
rel="noopener noreferrer"
>
Redux Toolkit
</a>
,<span> and </span>
<a
className="App-link"
href="https://react-redux.js.org/"
target="_blank"
rel="noopener noreferrer"
>
React Redux
</a>
</span>
</header>
</div> </div>
</Router>
); );
} }
......
import React from 'react';
import './index.css';
export default () => {
return (
<div>
<h1>Home page111</h1>
</div>
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment