Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 86e865b

Browse files
authored
Merge pull request #49 from TeaBough/master
Fix context of hocWithReducer
2 parents a1d1187 + b0a8930 commit 86e865b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/utils/injectReducer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import hoistNonReactStatics from 'hoist-non-react-statics';
3-
import { useStore } from 'react-redux';
3+
import { useStore, ReactReduxContext } from 'react-redux';
44

55
import { getInjectors } from './reducerInjectors';
66
import { InjectReducerParams, InjectedStore } from 'types';
@@ -22,6 +22,7 @@ export default function hocWithReducer<P>({
2222
): React.ComponentType<P> {
2323
// dont wanna give access to HOC. Child only
2424
class ReducerInjector extends React.Component<P> {
25+
public static contextType = ReactReduxContext;
2526
public static WrappedComponent = WrappedComponent;
2627
public static displayName = `withReducer(${WrappedComponent.displayName ||
2728
WrappedComponent.name ||

0 commit comments

Comments
 (0)