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

connected-router typescript declaring global state type

Newish to typescript - I have defined my global state based on the state of the redux root-reducer. This was working great until I decided to use connected-router - which adds some stuff to the root reducer - now I am uncertain how to declare the…
Nick McLean
  • 601
  • 1
  • 9
  • 23
0
votes
1 answer

I'm getting this error after upgrading react, redux versions

I've updated react versions. And jumping from react-router-redux to connected-react-router. Providing package.json file below. mostly it's happening after upgraded react latets version. So getting following error. index.js:31 Uncaught TypeError:…
0
votes
1 answer

Argument of type 'CallHistoryMethodAction<[string, unknown?]>' is not assignable to parameter of type 'UserActionType'

Development environment : react + typescript + connected-react-router What I intended : I want to use the router action asynchronously in the user action. So when login is complete I want my application to go to the main screen. Error Message :…
0
votes
1 answer

Resetting redux states on url change

I have a project that redux working on. But when I click on a component or click on to the "previous page" button on chrome, redux keeps the states I changed before. I tried the LOCATION_CHANGE action from connected-react-router and use it in…
Yusuf Ziya
  • 107
  • 7
0
votes
1 answer

history.push redirect overrides the the path I set to different one

I have this widget the whole thing is clickable to a certain path. I put two buttons inside it, edit and remove remove is working properly it execute a saga. now edit button I want it to be a link that redirects to certain URL. and I cannot do it…
0
votes
2 answers

yield axios.get() call in Saga changes the pathname to the default location "/"

I have have this Saga for retrieving the token from localStorage and sign in the user automatically export function* authCheckState(action) { const token = localStorage.getItem("jwt"); const expDate = localStorage.getItem("expDate"); if…
usertest
  • 2,140
  • 4
  • 32
  • 51
0
votes
1 answer

How to prevent react page from re-rendering when using connected-react-router

-MainPage.js import { push } from 'connected-react-router'; const showDataPage = () => { dispatch(push(ROUTES.DATA)) } -DataPage.js export const DataPage = () => { const dispatch = useDispatch(); React.useEffect(() => { …
NinjaDev
  • 402
  • 2
  • 6
0
votes
1 answer

Trying to migrate from React router v3 to v5 , Unable to figure out how to pass 'props.children' and redirect after authentication

The project uses redux integration ,initial routes look something like this : const userIsAuthenticated = connectedReduxRedirect({ redirectPath: `\login`, redirectAction: routerActions.replace, wrapperDisplayName:…
roma
  • 141
  • 5
  • 18
0
votes
3 answers

react redux - how to reload the page instead of "push"

I have a thunk action that logout the user inside the logout thunk action I have this: dispatch(push('/login')); I would like to redirect the user with a "refresh" to logout in order to refresh the page and. "clean' the state also, I would like…
Tuz
  • 1,810
  • 5
  • 29
  • 58
0
votes
1 answer

React- connected-router could not show images from base name

I have changed to basename to be '/test' now I could not open local images that in the same folder history.ts import { History, createBrowserHistory } from 'history'; export const history: History = createBrowserHistory({ basename:…
Tuz
  • 1,810
  • 5
  • 29
  • 58
0
votes
1 answer

TypeError: Cannot read property 'location' of undefined - connected-react-router - ReactRouter v5

Hello, I built an app using React and Redux, I searched for how handling redirection after a redux action and I found the connected-react-router package from ReactRouter, I followed all the official documentation but I get the following error :…
Mickael Zana
  • 261
  • 2
  • 6
  • 22
0
votes
1 answer

Issue with connected-react-router

I have created the following routes using connected-react-router as shown below But when…
0
votes
1 answer

Connected React Router - Don't update the view

I kinda need an advice here ... I'm learning how to build a full app based on react. Here is the test app : https://codesandbox.io/s/cranky-platform-46sjl Using React , Redux, Saga and typescript. Everything work so far except the routing : -Custon…
0
votes
1 answer

Cannot do routing within Redux Observable epic

There are very similar problems asked already but none of them works or they are different from my case. My goal: I want to change the '/login' route to '/' route within my redux Observable epic. I'd like to do a simple login and when the…
0
votes
0 answers

react typescript: No overload matches this call - connect react-redux to component

I have a counter component with counter reducer and store, implement in typescript. I don't manage to connect the component to a store with typing. and I got an issue when I define a state in the store. I am also using connected-react-router and it…
Tuz
  • 1,810
  • 5
  • 29
  • 58