Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentWillReceiveProps(nextProps) {
- if (this.state.id !== nextProps.match.params.id && nextProps.homepage.categories !== null) {
- this.setState(
- {
- category: nextProps.homepage.categories.find(
- cat => cat.id == nextProps.match.params.id
- ),
- courses: [],
- count: 0
- },
- this.search(0, nextProps.match.params.id)
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement