Created
November 10, 2018 15:54
-
-
Save productioncoder/9b2bbd393711dfdb9025f84370e76380 to your computer and use it in GitHub Desktop.
Youtube in React: force watch component to re render when search params change
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
/* ... */ | |
class App extends Component { | |
render() { | |
return ( | |
<AppLayout> | |
<Switch> | |
<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