Skip to content

Commit

Permalink
Little fix from official guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Jan 10, 2017
1 parent c0326a2 commit e488de8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/advanced/ExampleRedditAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down

0 comments on commit e488de8

Please sign in to comment.