Permalink
Browse files

Merge pull request #2196 from bloodyowl/patch-1

Little fix from official guidelines
  • Loading branch information...
2 parents c0326a2 + e488de8 commit 3ba1a84ab87d732a5b6f16314b8510dd2a5e8d6b @markerikson markerikson committed on GitHub Jan 11, 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 3ba1a84

Please sign in to comment.