Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidUpdate(prevProps, prevState){
- if (prevProps.match.params.vendor !== this.props.match.params.vendor &&
- this.props.myArray.length > 1){
- this.props.myDispatchedAction();
- }
- }
- useEffect(() => {
- if (myArray.length > 1){
- myDispatchedAction();
- }
- }, [match.params.vendor, myDispatchedAction, myArray]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement