Closed
Description
Is not working with react redux 6.0.1, the problem is the store value in the context, is coming undefined, looks like the current version of "ui-router/redux" is using the legacy React context API.
I builded this solution for my project but the context API should be change it for future versions of React.
import store from '@store';
import { pushStateLocationPlugin, UIView } from '@uirouter/react';
import { ConnectedUIRouter } from '@uirouter/redux/lib/react';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import config from './config';
import { router } from './index';
import states from './states';
const plugins = [
pushStateLocationPlugin
];
export default class AppRouter extends React.Component<any> {
public static childContextTypes = {
store: PropTypes.object
};
public getChildContext() {
return {
store,
};
}
public render() {
return (
<ConnectedUIRouter
router={router}
plugins={plugins}
states={states}
config={config}
>
<UIView />
</ConnectedUIRouter>
);
}
}
Metadata
Metadata
Assignees
Labels
No labels