Permalink
Browse files

Little fix from official guidelines

  • Loading branch information...
1 parent c0326a2 commit e488de86d155979192b82d98a69d2e920f205f71 @bloodyowl bloodyowl committed on GitHub Jan 10, 2017
Showing with 3 additions and 3 deletions.
  1. +3 −3 docs/advanced/ExampleRedditAPI.md
@@ -226,9 +226,9 @@ class AsyncApp extends Component {
dispatch(fetchPostsIfNeeded(selectedSubreddit))
}
- componentWillReceiveProps(nextProps) {
- if (nextProps.selectedSubreddit !== this.props.selectedSubreddit) {
- const { dispatch, selectedSubreddit } = nextProps
+ componentDidUpdate(prevProps) {
+ if (this.props.selectedSubreddit !== prevProps.selectedSubreddit) {
+ const { dispatch, selectedSubreddit } = this.props
dispatch(fetchPostsIfNeeded(selectedSubreddit))
}
}

0 comments on commit e488de8

Please sign in to comment.