Questions tagged [connected-react-router]

connected-react-router allows the binding of the react-router state with the redux store.

Developer documentation and resources:

94 questions
3
votes
0 answers

How to do Routing with redux-saga in Next.js app

I'm trying to migrate my react app to next.js app. I like redux-saga I like routing in redux-saga logic And I want to do routing in redux-saga logic as I used to do! but I cannot figure out how to do this. question is.. How to route with…
byyoung
  • 327
  • 3
  • 10
3
votes
1 answer

return type for redux root reducer

I am convert my root reducer from javascript to typescript, however, I am getting a linting error saying: Missing return type on function. (@typescript-eslint/explicit-function-return-type) What should be the proper return type for my root…
Jimmy
  • 3,090
  • 12
  • 42
  • 99
3
votes
1 answer

Can't deal with Uncaught TypeError: Cannot read property 'location' of undefined at createRouterReducer

I have a problem with connecting a Router to a rootReducer, console logs Uncaught TypeError: Cannot read property 'location' of undefined at createRouterReducer (reducer.js?005c:9) ... Don't know how to fix it and connect the router…
3
votes
1 answer

Basename not working connected-react-router

I'm using connected-react-router with my react redux app. I need server side rendering and client side rendering (I'm using a react component in a symfony twig template via limenius react bundle). My probleme is that i cannot use basename properly.…
Tralgar
  • 240
  • 4
  • 14
3
votes
0 answers

How to use connected-react-router with redux-react-hook

I am new to react, I would like to use react hooks with redux (with redux-react-hook) with routing (I use connected-react-router but I can switch to another lib) I pass the store to the StoreContext Provider, everything is okay, but when I add the…
Gatoyu
  • 642
  • 1
  • 6
  • 22
2
votes
1 answer

Error: Invariant failed: You should not use outside a

I am doing a login page using react-redux. After the user provides the correct id and password to the app, it should redirect the user to the homepage. The error above shows when I using . If I change to using the no error show but the page not…
2
votes
0 answers

Is it possible to catch location change event inside reducer while I am using connected-react-router?

In my react app, I am using the connected-react-router library which is helpful to manage routing inside the redux part. Today, I have faced a case that needs to capture location change event inside reducer. I was thinking it would be possible by…
2
votes
1 answer

Uncaught Could not find router reducer in state tree, it must be mounted under "router"

React router works normal. But if I add or call from , I have this exception: Uncaught Could not find router reducer in state tree, it must be mounted under "router" rootReducer.js: import { combineReducers } from 'redux'; …
2
votes
0 answers

"Could not find router reducer" error when using connected-react-router

I repeatedly get a Could not find router reducer in state tree, it must be mounted under "router" error when I do a dispatch(push("/")); call. index.tsx const store = configureStore(); ReactDOM.render(
2
votes
1 answer

Can't print child components of nested routes on React Router v5

I can't seem to figure out how to print child routes in React Router v5. Here is how I have setup my application. 1) index.jsx ReactDOM.render(
2
votes
0 answers

I need some help migrating from react-router-redux to connected-react-router

I am trying to upgrade my existing codebase and moving from react-router-redux to connected react-router. Couldn't find much resources on migration, however this has helped me significantly. I am unable to find any resource on how to get access to…
Alien128
  • 313
  • 1
  • 2
  • 18
2
votes
1 answer

Connected-React-Route change still causes typeError to appear

I am using connected-react-router history to navigate to the login screen when a users authentication times out. To do this I use axios interceptors to catch all responses and check to see if they're returning an error message that indicates the…
Haq.H
  • 863
  • 7
  • 20
  • 47
2
votes
1 answer

Redux-Persist and Connected-React-Router: TypeError: Cannot read property 'location' of undefined

I am trying to get React app to work properly with React Router and Redux, but I constantly getting TypeError: Cannot read property 'location' of undefined to any components that have redux. I am using connected-react-router lib to register router…
GYTO
  • 440
  • 1
  • 10
  • 23
2
votes
0 answers

on BackButton: Component does not update although url is changed

When clicking on the back button , the url gets changed, but the component that should be rendered for this url, is not rendered. Rerendering seems to be blocked. I am using connected-react-router. Before implementing connected-react-router, the…
JuliaG
  • 21
  • 1
2
votes
0 answers

protected routes issue switching from react-router-redux to connected-react-router

I am in progress of migrating my app to from react-router-redux -to --> connected-react-router however, I'm seeing an issue. Currently, I have certain routes that are protected(requires authed users) i.e dashboard export default function…
jasan
  • 11,475
  • 22
  • 57
  • 97