New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React-router <Link> does not work #29
Comments
Need to confirm if documentation examples work as expected. Related to: #28 |
@gajus Cool! So are you saying that there are other ways of using this package that aren't covered by the documentation? |
Actually looking over that issue, I am not sure that those changes affect my problem. As in, I notice that they suggest only going one level deep into the
So I am not sure if that gets one step closer to uncovering the issue, but it definitely does not fix anything for me. |
I have exactly the same issue. When i go from the URL directly it works, but if y do |
I had exactly the same issue and ended up reading through https://github.com/reactjs/react-router-redux/blob/v4.0.2/src/sync.js and https://github.com/reactjs/react-router-redux/blob/v4.0.2/src/reducer.js I then tried changing the
const Immutable = require('immutable');
const ReactRouterRedux = require('react-router-redux');
const initial_state = Immutable.fromJS({
locationBeforeTransitions: null
});
function routing (state = initial_state, action) {
if (action.type === ReactRouterRedux.LOCATION_CHANGE) {
return state.merge({
locationBeforeTransitions: action.payload
});
}
return state;
}
module.exports = routing; Snippet from const history = ReactRouterRedux.syncHistoryWithStore(ReactRouter.browserHistory, store, {
selectLocationState (state) {
return state.get('routing').toJS();
}
}); |
I can confirm that the new changes to the documentation (mainly changing the reducer property to |
I am using this package with
react-redux-router
. While manually changing the URL in my browser does follow my routes and take me to the correct page, if I try to use the<Link>
component provided byreact-router
(or even use thepush
action creator fromreact-redux-router
) nothing happens. A link gets created and I can inspect and see it has the correcthref
, but clicking on it does nothing.I believe this is probably an issue with the history not syncing correctly with the store, but I feel like I am following the documentation correctly. Has anyone else been successful in using that component with this package? Not sure if I'm doing something wrong or if this is a real bug.
react v0.14.8
react-router v2.3.0
react-router-redux v4.0.2
redux-immutable v3.0.6
I am adding the
LOCATION_CHANGE
reducer. Note that while I call itrouting
here, I have also called itroute
androutes
to no avail.reducers.js
I have a custom store configuration file where I add
combineReducers
from this package.configureStore.js
Then I add this store, sync it with the router history, and add it to my app wrapper (that gets loaded into the DOM). This is where I suspect the problems are coming in. Once again, while I call the piece of state
routing
here, I have also triedroute
androutes
.app.js
Any thoughts on why the
<Link>
component wouldn't be working with a setup like this?The text was updated successfully, but these errors were encountered: