Skip to content

Commit decc035

Browse files
authored
Remove support for legacy context (#1575)
* Remove support for legacy context * Create chatty-walls-burn.md
1 parent 6f9ef2e commit decc035

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

.changeset/chatty-walls-burn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@redux-devtools/core': major
3+
---
4+
5+
Remove support for legacy context. Minimum supported react-redux version is 7.0.0 and minimum support React version is 16.8.4.

packages/redux-devtools/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"typescript": "~5.3.3"
7575
},
7676
"peerDependencies": {
77-
"react": "^0.14.9 || ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
78-
"react-redux": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
77+
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
78+
"react-redux": "^7.0.0 || ^8.0.0 || ^9.0.0",
7979
"redux": "^3.5.2 || ^4.0.0 || ^5.0.0"
8080
}
8181
}

packages/redux-devtools/src/createDevTools.tsx

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ function logError(type: string) {
2525
}
2626
}
2727

28-
export interface Props<
29-
S,
30-
A extends Action<string>,
31-
MonitorState,
32-
MonitorAction extends Action<string>,
33-
> {
28+
export interface Props<S, A extends Action<string>, MonitorState> {
3429
store?: EnhancedStore<S, A, MonitorState>;
3530
}
3631

@@ -65,9 +60,7 @@ export default function createDevTools<
6560
(state: LiftedState<S, A, MonitorState>) => state,
6661
)(Monitor as React.ComponentType<any>);
6762

68-
return class DevTools extends Component<
69-
Props<S, A, MonitorState, MonitorAction>
70-
> {
63+
return class DevTools extends Component<Props<S, A, MonitorState>> {
7164
liftedStore?: LiftedStore<S, A, MonitorState>;
7265

7366
static instrument = (
@@ -78,11 +71,8 @@ export default function createDevTools<
7871
options,
7972
);
8073

81-
constructor(
82-
props: Props<S, A, MonitorState, MonitorAction>,
83-
context?: { store?: EnhancedStore<S, A, MonitorState> },
84-
) {
85-
super(props, context);
74+
constructor(props: Props<S, A, MonitorState>) {
75+
super(props);
8676

8777
if (ReactReduxContext) {
8878
if (this.props.store && !this.props.store.liftedStore) {
@@ -91,16 +81,12 @@ export default function createDevTools<
9181
return;
9282
}
9383

94-
if (!props.store && !context?.store) {
84+
if (!props.store) {
9585
logError('NoStore');
9686
return;
9787
}
9888

99-
if (context?.store) {
100-
this.liftedStore = context.store.liftedStore;
101-
} else {
102-
this.liftedStore = props.store!.liftedStore;
103-
}
89+
this.liftedStore = props.store.liftedStore;
10490

10591
if (!this.liftedStore) {
10692
logError('NoLiftedStore');

0 commit comments

Comments
 (0)