pagedlist: fix refresh on wrapped components

This commit is contained in:
Saúl Ibarra Corretgé 2019-07-26 09:08:01 +02:00 committed by Saúl Ibarra Corretgé
parent 1c27f567ee
commit 49f6010905
1 changed files with 4 additions and 1 deletions

View File

@ -147,7 +147,10 @@ class PagedList extends Component<Props, State> {
let component; let component;
if (selectedPage && (component = selectedPage.component)) { if (selectedPage && (component = selectedPage.component)) {
const { refresh } = component; // react-i18n / react-redux wrap components and thus we cannot access
// the wrapped component's static methods directly.
const component_ = component.WrappedComponent || component;
const { refresh } = component_;
refresh.call(component, this.props.dispatch, isInteractive); refresh.call(component, this.props.dispatch, isInteractive);
} }