Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Using basename for history causes infinite loop #64

Closed
kromit opened this issue Dec 1, 2015 · 3 comments
Closed

Using basename for history causes infinite loop #64

kromit opened this issue Dec 1, 2015 · 3 comments

Comments

@kromit
Copy link

kromit commented Dec 1, 2015

I want to run my app in a context so i need a history basename:

import {createHistory,useBasename} from 'history';
const history = useBasename(createHistory)({
    basename: '/mybase'
});

I also use an onEnter in the route which loads current session and calls dispatch. The dispatch runs into the syncReduxAndRouter and call pushState causing the loop. This happens because redux-simple-router uses window.location to check the changes and is not is not aware of the basename used in the history so it always calls pushState

@kromit
Copy link
Author

kromit commented Dec 1, 2015

0.0.10 fixed this

@kromit kromit closed this as completed Dec 1, 2015
@neverfox
Copy link

@kromit I'm getting the infinite loop with 1.0.1.

@neverfox
Copy link

Got around it by bumping history to 1.17.0, but now I've posted #146 as an ongoing issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants