mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-21 17:16:42 +03:00
Remove support for legacy context (#1575)
* Remove support for legacy context * Create chatty-walls-burn.md
This commit is contained in:
parent
6f9ef2e941
commit
decc035570
5
.changeset/chatty-walls-burn.md
Normal file
5
.changeset/chatty-walls-burn.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@redux-devtools/core': major
|
||||
---
|
||||
|
||||
Remove support for legacy context. Minimum supported react-redux version is 7.0.0 and minimum support React version is 16.8.4.
|
|
@ -74,8 +74,8 @@
|
|||
"typescript": "~5.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^0.14.9 || ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-redux": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
||||
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
||||
"react-redux": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
||||
"redux": "^3.5.2 || ^4.0.0 || ^5.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,7 @@ function logError(type: string) {
|
|||
}
|
||||
}
|
||||
|
||||
export interface Props<
|
||||
S,
|
||||
A extends Action<string>,
|
||||
MonitorState,
|
||||
MonitorAction extends Action<string>,
|
||||
> {
|
||||
export interface Props<S, A extends Action<string>, MonitorState> {
|
||||
store?: EnhancedStore<S, A, MonitorState>;
|
||||
}
|
||||
|
||||
|
@ -65,9 +60,7 @@ export default function createDevTools<
|
|||
(state: LiftedState<S, A, MonitorState>) => state,
|
||||
)(Monitor as React.ComponentType<any>);
|
||||
|
||||
return class DevTools extends Component<
|
||||
Props<S, A, MonitorState, MonitorAction>
|
||||
> {
|
||||
return class DevTools extends Component<Props<S, A, MonitorState>> {
|
||||
liftedStore?: LiftedStore<S, A, MonitorState>;
|
||||
|
||||
static instrument = (
|
||||
|
@ -78,11 +71,8 @@ export default function createDevTools<
|
|||
options,
|
||||
);
|
||||
|
||||
constructor(
|
||||
props: Props<S, A, MonitorState, MonitorAction>,
|
||||
context?: { store?: EnhancedStore<S, A, MonitorState> },
|
||||
) {
|
||||
super(props, context);
|
||||
constructor(props: Props<S, A, MonitorState>) {
|
||||
super(props);
|
||||
|
||||
if (ReactReduxContext) {
|
||||
if (this.props.store && !this.props.store.liftedStore) {
|
||||
|
@ -91,16 +81,12 @@ export default function createDevTools<
|
|||
return;
|
||||
}
|
||||
|
||||
if (!props.store && !context?.store) {
|
||||
if (!props.store) {
|
||||
logError('NoStore');
|
||||
return;
|
||||
}
|
||||
|
||||
if (context?.store) {
|
||||
this.liftedStore = context.store.liftedStore;
|
||||
} else {
|
||||
this.liftedStore = props.store!.liftedStore;
|
||||
}
|
||||
this.liftedStore = props.store.liftedStore;
|
||||
|
||||
if (!this.liftedStore) {
|
||||
logError('NoLiftedStore');
|
||||
|
|
Loading…
Reference in New Issue
Block a user