UNPKG

resau

Version:

React 16.3's new [Context API](https://reactjs.org/docs/context.html) is very promising. Who knows that in the future we're no longer need the likes of Redux for our app's state management? For more information, [this article](https://medium.freecodecamp.

22 lines (18 loc) 612 B
import React from "react"; import { Route, Switch, withRouter } from "react-router-dom"; import PageTransition from "react-router-page-transition"; import { List } from "./../../components"; import Detail from "./../Detail"; class App extends React.PureComponent { render() { return ( <PageTransition timeout={500}> <Switch location={this.props.location}> <Route exact path="/" render={props => <List {...props} />} /> <Route path="/item" render={props => <Detail {...props} />} /> </Switch> </PageTransition> ); } } export default withRouter(App);