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
2
votes
1 answer

Issue implementing ConnectedRouter with react-router v4 upgrade

I upgraded to use react-router v4 (rr-v4) and read that react-router-redux has been deprecated and for rr-v4 to use connected-react-router. In doing so I now get the following error: The prop location is marked as required in ConnectedRouter, but …
user1015196
  • 617
  • 1
  • 7
  • 24
2
votes
1 answer

`push` from "connected-react-router" used in redux-observable epic doesn't change the url and renders empty page

push from "connected-react-router" used in redux-observable epic doesn't change the url and renders empty page. state.router.location never changes, so I think that the action does not get dispatched properly, but the components are not rendered any…
Galya
  • 6,294
  • 6
  • 27
  • 45
2
votes
2 answers

Are `redux-loop` and `connected-react-router` compatible?

I have made a simple react app with the sample code from the following blogpost, which I leave only as a citation. I am otherwise new to the javascript ecosystem and am trying to fit together several unfamiliar tools (in order to learn…
Richard Rast
  • 1,772
  • 1
  • 14
  • 27
1
vote
0 answers

What should I do if I want to use connected-react-router for redux with react-router@6

I want to redirect after processing the operations file. However, connected-react-router cannot be used with react-router v6. What is a way to resolve this? operations.ts import { push } from 'connected-react-router'; export function…
1
vote
1 answer

CartItems routing error using React-Router-Dom v6

I am trying to introduce 'cartItems' functionality to my react-redux app and store the added data in the browser's local storage. Indeed the problem raises when I try to show cart items by clicking on the cart link at the navbar section. The error…
1
vote
2 answers

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

I am using these versions "react": "^17.0.2", "react-dom": "^17.0.2" "react-router-dom": "^5.2.0" "connected-react-router": "^6.8.0" "history": "4.10.1" export const browserHistory = createBrowserHistory({ basename: '/clearance-authorization' }) i…
1
vote
1 answer

Uncaught TypeError: Cannot read properties of undefined (reading 'pathname') after version migration of react-router-redux to connecter-react-router

I was working with old packages in my react project. Now im on process of upgrading the old version. After changing the react-router-redux to connected-react-router i have encountered with this error.
1
vote
2 answers

Configure reducers of connected-react-router and Redux Toolkit Query properly

I am trying to setup reducers of both connected-react-router and RTK Query. (The old code base has connected-react-router already) Then I received this error. fail to setup connectRouter Type 'Reducer, AnyAction>' is not…
1
vote
0 answers

Having issue with push(''/') what could be wrong?

I am using the connected react router for routing in my project. It seems to work as expected unless I use push('/'). This does not change the URL. If i remove exact from the route definition it changes the content shown to be what I want but not…
radulfr
  • 114
  • 3
  • 13
1
vote
0 answers

using routerMiddleware function in react and redux

how can I use routerMiddleware to pass history to redux. I have tried below but not working. I couldn't find any resources that integrate the routerMiddleware. Here, I am trying to react-admin dashboard where it asks to pass history as props to…
1
vote
0 answers

Uncaught SyntaxError: Unexpected token '<' when navigate to route with 2 or more path element after ci deployment

After ci deployment, I try to navigate to '/records/:id' or other routes with 2 or more path elements and will get this error in the console. This error never comes out when running in local. Uncaught SyntaxError: Unexpected token '<' I had used…
chingcong
  • 11
  • 1
1
vote
1 answer

Correctly initializing the store on the server for SSR of React.JS app made with ConnectedRouter

I am trying to do SSR for a React App made with Redux, Saga, and ConnectedRouter. I found a couple of relevant examples, specifically https://github.com/mnsht/cra-ssr and https://github.com/noveogroup-amorgunov/react-ssr-tutorial Those I understand…
1
vote
1 answer

How to reset the state of a Redux store using connected-react-router?

I'm trying to acheive this exact same behaviour How to reset the state of a Redux store?. except I'm using connected-react-router. My Configuration looks like this: Reducer export const rootReducer = history => combineReducers({ auth:…
usertest
  • 2,140
  • 4
  • 32
  • 51
1
vote
0 answers

While using connected-react-router, router reducer isn't found

This is my store.ts import { createStore, compose, applyMiddleware } from 'redux'; import createSagaMiddleware from 'redux-saga'; import rootSaga from 'sagas'; import rootReducer from 'reducers'; import { history } from…
1
vote
2 answers

How do you pass ":" in a URL without referring to a dynamic value in React?

The problem is that when you want to introduce a dynamic value to a url is that you have to use ":" to refer to it. For example, let's say I have a list with a lot of users and I add a button to get more info about them, and I want the URL to have…