Skip to content

Instantly share code, notes, and snippets.

@supachaic
Created January 7, 2019 13:49
Show Gist options
  • Save supachaic/562d395312db9d6d343ad9ba0f911bea to your computer and use it in GitHub Desktop.
Save supachaic/562d395312db9d6d343ad9ba0f911bea to your computer and use it in GitHub Desktop.
src/App.js final look
import React, { Component } from 'react';
import { Route, Router } from 'react-router-dom';
import createHistory from 'history/createBrowserHistory';
import './App.css';
import Home from './views/Home';
import ImageInput from './views/ImageInput';
import VideoInput from './views/VideoInput';
class App extends Component {
render() {
return (
<div className="App">
<Router history={createHistory({ basename: process.env.PUBLIC_URL })}>
<div className="route">
<Route exact path="/" component={Home} />
<Route exact path="/photo" component={ImageInput} />
<Route exact path="/camera" component={VideoInput} />
</div>
</Router>
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment