Created
November 24, 2018 13:27
-
-
Save productioncoder/c6ee1c64ab0d9c139d09e909ea90c652 to your computer and use it in GitHub Desktop.
Youtube in React: wiring up Search component with react-router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Search from './containers/Search/Search'; | |
/* ... */ | |
class App extends Component { | |
render() { | |
return ( | |
<AppLayout> | |
<Switch> | |
<Route path="/feed/trending" component={Trending}/> | |
<Route path="/results" render={() => <Search key={this.props.location.key}/>}/> | |
<Route path="/watch" render={() => <Watch key={this.props.location.key}/>}/> | |
<Route path="/" component={Home}/> | |
</Switch> | |
</AppLayout> | |
); | |
} | |
/* ... */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment