connectedRouter Error: Could not find router reducer in state tree, it must be mounted under “router”

后端 未结 6 1605
轮回少年
轮回少年 2021-01-01 15:09

I am new to React.js and was setting up base project at that I was getting one issue that my routing got changed but component doesn\'t load. After googling I found that I n

6条回答
  •  梦谈多话
    2021-01-01 15:57

    I ran into the same issue. I forgot to give the history as a parameter to my rootReducer, in my store initialization.

    const store = createStore(
      rootReducer(history), // <-- HERE
      {},
      ...
    )
    

提交回复
热议问题