Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. componentDidUpdate(prevProps, prevState){
  2. if (prevProps.match.params.vendor !== this.props.match.params.vendor &&
  3. this.props.myArray.length > 1){
  4. this.props.myDispatchedAction();
  5. }
  6. }
  7.  
  8. useEffect(() => {
  9. if (myArray.length > 1){
  10. myDispatchedAction();
  11. }
  12. }, [match.params.vendor, myDispatchedAction, myArray]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement