React Hooks with React Router v4 - how do I redirect to another route?

后端 未结 3 1706
鱼传尺愫
鱼传尺愫 2021-02-13 05:30

I have a simple react hooks application - a list of Todos - with react router v4

On the List of Todos, when a Todo is clicked I need to:

  1. Dispatch the curre
3条回答
  •  野性不改
    2021-02-13 05:33

    Using react-redux and connected-react-router...

    import {useDispatch } from 'react-redux';
    import { push } from 'connected-react-router';
    
    export default () => {
     const dispatch = useDispatch();
    
     return (
           
      );
    };
    

提交回复
热议问题