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

512 questions
19
votes
4 answers

React-router Link, pass in params

If you have a route such as: And then you export that route, and so it can be used across your app, such as: export const MY_ROUTE = '/users/:userId/'; How do you set the param in a link…
Elliot
  • 13,580
  • 29
  • 82
  • 118
14
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,270
  • 2
  • 21
  • 43
14
votes
2 answers

Trying to setup redux history so I can redirect

I am trying to following this react router redux so I can redirect using the push('/') in my components or actions. Tutorial: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux I am not sure what I missing but I am…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
13
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…
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
  • 263
  • 1
  • 4
  • 16
12
votes
4 answers

Configuring app's basename in react-router

I'm struggling a bit with react-router 2.x configuration, specifically app basename. I've an application which may have different base root throughout its lifecycle. For instance: / in development /users in production /account in production after…
Ilya Ayzenshtok
  • 721
  • 2
  • 7
  • 18
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

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,189
  • 2
  • 11
  • 27
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
  • 69,002
  • 70
  • 275
  • 438
10
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
  • 280
  • 1
  • 5
  • 16
10
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
  • 173
  • 1
  • 8
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
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…
The Coder
  • 3,447
  • 7
  • 46
  • 81
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…
1
2
3
34 35