Questions tagged [react-router-redux]

A library of bindings to keep react-router and redux in sync (formerly known as redux-simple-router).

A library of bindings to keep react-router and redux in sync (formerly known as redux-simple-router).


Related tags

502 questions
14
votes
6 answers

componentWillReceiveProps method doesn't run anymore when using redux to call api

I'm going to call api using redux: I used axios,history,react-redux,react-router-native,react-router,,redux-promise-middleware,redux-thunk component to make api call using redux: I made Reducers folder and put all my reducer file there in their own…
14
votes
2 answers

Is there a way to expose route params outside component?

If I have something like this: My routes config looks like: export default [{ path: '/', exact: true, main: Home }, { path: '/:someId', exact: true, main:…
13
votes
3 answers

Change default color of Link from blue to white

I am using Link component from react-router-link which applies blue color css to the text just like an anchor tag does. I want to change this to white, how can I do that? onHover I want to change it to blue.
Lokesh Agrawal
  • 3,269
  • 6
  • 28
  • 66
13
votes
3 answers

React Router 4.x - PrivateRoute not working after connecting to Redux

PrivateRoute available in Example https://reacttraining.com/react-router/web/example/auth-workflow is not working after connecting with Redux. My PrivateRoute look almost same to the original version but only connected to Redux and used it instead…
13
votes
3 answers

infinite loop when dispatching in componentWillReceiveProps

I have a Profile component that is loaded by react-router (path="profile/:username") and the component itself looks like this: ... import { fetchUser } from '../actions/user'; class Profile extends Component { constructor(props) { …
hazmah0
  • 253
  • 1
  • 4
  • 15
12
votes
3 answers

Deploying react-redux app in AWS S3

I have gone through lot of similar questions in stack overflow like this one. Each one have different perspective of deploying the react app. But this question is for those who use redux, react-router and react-router-redux. It took me lot of time…
12
votes
3 answers

How to handle logout route in Redux?

I want to define a URL that could be used to logout the user (dispatch an action that would logout the user). I have not found examples showing how to implement a route dispatching an event.
Gajus
  • 55,791
  • 58
  • 236
  • 384
11
votes
3 answers

Update Redux state on route change

I've been trying to figure this out for a while and I'm getting more and more confused. I want to reset/change Redux state every time I leave or change route. I'm using react-router-redux with history.listener dispatching an action every time route…
spik3s
  • 1,169
  • 2
  • 11
  • 26
10
votes
1 answer

React-Router-Redux and React-Bootstrap

I've been battling this one for a while! I want to have the 'main app container' which always has the logo, navigation... I want to use react-bootstrap to pretty it up. At the moment I'm running into problems, my project is based off davezuko's…
user2342062
9
votes
2 answers

Resetting redux state on logout

I am trying to deal with the problem, addressed, in general in an earlier thread - How to reset the state of a Redux store? - the need to reinitialize/invalidate the entire redux store on user logout. In my case, however, something is still missing.…
Moshe Shmukler
  • 1,116
  • 2
  • 18
  • 35
9
votes
1 answer

react-router-redux vs connected-react-router for react v4

official github page of react-router-redux says that the project is no longer maintained and is now deprecated. They recommend to use connected-react-router instead. react-router-redux has: 31k stars 884 watch 6k forks while connected-react-router…
TheCoder
  • 2,157
  • 2
  • 25
  • 57
9
votes
1 answer

React-Router-Redux: export 'syncHistoryWithStore' was not found in 'react-router-redux'

I've been trying to integrate Redux into my application, and am experiencing an issue using React-Router-Redux 5.0.0-alpha.6 I receive error: "export 'syncHistoryWithStore' was not found in 'react-router-redux'. The official guides say to import…
9
votes
2 answers

React Native - Navigate after an async action

I'm developing a mobile app with React Native and Redux and I'm facing a software design problem. I want to call a REST API (async operation) for login and navigate to main view if that operation was successful. I'm using redux and thunk so I…
user3299310
  • 153
  • 1
  • 7
8
votes
3 answers

React-Router v4 + Redux-Saga navigation

I am trying to move user after successfull authentication process (after login / register) however it looks like every solution which I found on the internet - stackoverflow / github issues / medium etc - doesnt work! please find my code…
Rachomir
  • 240
  • 2
  • 14
8
votes
4 answers

react-router-redux: Cannot read property 'listen' of undefined at syncHistoryWithStore

I'm in the process of Refactoring clean Ract app to Redux. I have deifned some actions and reducers tested. I got stack on Router & History. I'm getting error: Uncaught TypeError: Cannot read property 'listen' of undefined at…
mysiar
  • 392
  • 1
  • 3
  • 11
1
2
3
33 34