HoldTheLettuce
8/2/2018 - 5:15 AM

App w/ Routing

import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Home from './views/home/home';
import NotFound from './views/notfound/notfound';
import User from './views/user/user'; 
import './App.css';

class App extends Component {
  render() {
    return (
      <div className="App">
        <Router>
            <div>
              <Switch>
                <Route exact path="/" component={Home} />
                <Route path="/u/:username" component={User} />
                <Route path="*" component={NotFound} />
              </Switch>
            </div>
        </Router>
      </div>
    );
  }
}

export default App;