I am trying to make one of my components update if the length of an array in props does not match the previous. The problem is I make a redux action fire on componentWillMount. So when I pass this.props.array to the function in shouldComponentUpdate its initially empty and so it doesnt work how I want.
Im wondering if anyone has advice or knows a better way/fix for this? Thanks in advance.
componentDidMount() {
this.props.getAllCourses(this.props.user.id);
}
shouldComponentUpdate(nextProps) {
return compareCoursesProps(nextProps, this.props.courses);
}
render() {