import {browserHistory} from 'react-router';
import {createStore, compose} from 'redux';
import createTransitionEnhancerFromHistory from 'redux-history-transitions';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
state => state,
{},
composeEnhancers(
createTransitionEnhancerFromHistory(browserHistory)
)
);
store.dispatch({type: 'myAction'});
This causes Uncaught RangeError: Maximum call stack size exceeded as redux-history-transitions' dispatch continually calls itself. This does not occur when not using the extension or when only using other enhancers such as applyMiddleware and not redux-history-transitions. This also does not occur when using redux-devtools without the extension.
@gdaolewe, that's quite interesting, something related with how the dispatch is redefined there. I'll take a closer look tomorrow. Meanwhile, you can use the enhancer instead of window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:
import {browserHistory} from 'react-router';
import {createStore, compose} from 'redux';
import createTransitionEnhancerFromHistory from 'redux-history-transitions';
const store = createStore(
state => state,
{},
compose(
createTransitionEnhancerFromHistory(browserHistory),
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : noop => noop
)
);
store.dispatch({type: 'myAction'});
Should work in 2.9.1.
Most helpful comment
@gdaolewe, that's quite interesting, something related with how the
dispatchis redefined there. I'll take a closer look tomorrow. Meanwhile, you can use the enhancer instead ofwindow.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__: