Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. export const SomeItem = () => {
  2. const dispatch = useDispatch()
  3. const someSelector = useSelector(getItemsSelector)
  4.  
  5. // create component state props (just example)
  6. const [isLoadind, setLoading] = useState(false)
  7.  
  8. useEffect(() => {
  9. // componentDidMount
  10. dispatch(someAction)
  11. return function() {
  12. // componentWillUnmount
  13. dispatch(resetSomeAction)
  14. }
  15. }, [dispatch])
  16.  
  17. render() => <div/>
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement