React and Redux: redirect after action

后端 未结 6 1389
孤城傲影
孤城傲影 2020-12-30 01:43

I develop a website with React/Redux and I use a thunk middleware to call my API. My problem concerns redirections after actions.

I really do not know how and where

6条回答
  •  清酒与你
    2020-12-30 02:01

    Usually the better practice is to redirect in the component like this:

    render(){
       if(requestFullfilled){
           router.push('/item')
       }
       else{
           return(
              
           )
       }
    }
    

提交回复
热议问题