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
1
vote
1 answer

How to use connected-react-router's push within unit tests

I want to update the URL that is stored in my redux store by connected-react-router during testing, because some of my logic depends on that. When I dispatch a push, the actions gets logged (I was able to verify that using a logger middleware), but…
1
vote
1 answer

Redirecting during fetch epic with redux-observables and RxJS

I have a fetch Epic that may return a 401 or 403 if the user doesn't have access to a server-side resource. I want to redirect during this Epic if this is the case. Right now I'm doing this: export const fetch$ = (req: IRequest) => …
1
vote
1 answer

Why do and not trigger updates of state.router in connected-react-router?

After looking around at the various packages to combine redux with react-router, it looked as though connected-react-router was the most popular actively supported choice. I configured it pretty much exactly as in the docs, with one exception…
Nat Kuhn
  • 9,493
  • 5
  • 18
  • 26
1
vote
0 answers

dispatch push changing url but not rendering component

So basically i am doing a post request for login and upon success i want to dispatch the response and redirect the user to profile page. So dispatch the response works fine but upon doing dispatch(push('/profile')); the URL changes but the profile…
Nick Bb
  • 601
  • 1
  • 8
  • 18
1
vote
1 answer

connected-react-router app updates url but not components

I've double checked all the tutorials and FAQs but I can't seem to figure out where my problem lies. Full example here: https://stackblitz.com/edit/react-hmuwhx?embed=1&file=App.js Some code of interest below. Help appreciated! export const…
ryan
  • 6,541
  • 5
  • 43
  • 68
1
vote
1 answer

connected-react-router and office-ui-fabric-react

Related post on Github Currently I have a hard time using the two libraries in my react-redux app correctly. My codes look like: index.js import { Provider } from 'react-redux'; import { ConnectedRouter } from…
kemakino
  • 1,041
  • 13
  • 33
1
vote
1 answer

Navigating history/time travel in react-redux using connected-react-router

I would greatly appreciate any assistance or examples in how to implement time travel on a single-page react-redux app using connected-react-router. I just want to be able to program links to go back to step1 or step2 once I'm on step3 or step4 and…
1
vote
1 answer

Can't get Connected React Router set up properly

I'm trying to update to connected-react-router while updating all my React, Redux and Router versions. I am having trouble with the root reducer and store creation. The previous reducer code that was working was... const appReducer =…
user3775501
  • 188
  • 1
  • 2
  • 15
1
vote
1 answer

No location change upon connected-react-router push() from within the react-redux connect()

Dispatching the push action which was defined in mergeProps parameter of the react-redux connect() dispatches redux action but does not trigger url page change. I also wrapped the withRouter around the redux container but no seems to…
Stephen Isienyi
  • 1,292
  • 3
  • 17
  • 29
0
votes
1 answer

react-router-dom NavLink doesn't reflect isActive change without refreshing the page

I'm trying to use the NavLink's isActive prop to check whether the link's route is the current route to apply some visual styling. Whenever I navigate to a page it works correctly as expected. However, if I tap a link while I'm inside a page, the…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
0
votes
1 answer

Duplicate Parameter in URL React Js / Router

I am trying to build a Multi language React website, I have been struggling until i finally I prepare the structure, and now I am facing a problem which I think due to my misunderstanding of React Routes. I have a MainLayout Layout which provide…
0
votes
1 answer

Routing with react-router-dom, redux, apollo-client, connected-react-router and redux-persist

I am trying to configure an application and I am using: react class components, redux, react-redux, apollo-client, redux-persist and connected-react-redux and I am receiving the following error: "Uncaught TypeError: store.dispatch is not a…
0
votes
1 answer

how to have same path for multiple component with react-router

I use react-router 5x..., i search to have the same path but with multiple component, something like in my tsx i have export default (
0
votes
1 answer

How to change the router history in a functional component using react-redux

I'm trying to migrate a code base from a class component to a functional component, but when I do that my history (browserHistory) and the redirects stop working. I don't know if it's in the way I'm using useEffect, or forcing the history.push ? But…
0
votes
0 answers

CreateBrowserHistory not preserving history state on page refresh Chrome

I am working on a react app where I am using React-router along with connect-react-router for persisting routing information in redux. I am injecting the history to connected-react-router using the CreateBrowserHistory function provides by the…