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

Fix context of hocWithReducer #49

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/utils/injectReducer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { useStore } from 'react-redux';
import { useStore, ReactReduxContext } from 'react-redux';

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