App.js 570 Bytes
import React from 'react';
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import Landing from './Landing';
import Main from './Main';


class App extends React.Component {
    render() {
        return (
            <Router>
                <Switch>
                    <Route exact path="/landing" component={Landing} />
                    <Route exact path="/main" component={Main} />
                    <Redirect path="*" to="/landing" /> 
                </Switch>
            </Router>
        );
    }
}

export default App;