fix: Rerender Bundle on route change (#4120)

th-downstream
Sorin Davidoi 7 years ago committed by Eugen Rochko
parent f1827d5070
commit c202889d8d

@ -31,13 +31,11 @@ export class WrappedRoute extends React.Component {
} }
renderComponent = ({ match }) => { renderComponent = ({ match }) => {
this.match = match; // Needed for this.renderBundle const { component, content, multiColumn } = this.props;
const { component } = this.props;
return ( return (
<BundleContainer fetchComponent={component} loading={this.renderLoading} error={this.renderError}> <BundleContainer fetchComponent={component} loading={this.renderLoading} error={this.renderError}>
{this.renderBundle} {Component => <Component params={match.params} multiColumn={multiColumn}>{content}</Component>}
</BundleContainer> </BundleContainer>
); );
} }
@ -50,12 +48,6 @@ export class WrappedRoute extends React.Component {
return <BundleColumnError {...props} />; return <BundleColumnError {...props} />;
} }
renderBundle = (Component) => {
const { match: { params }, props: { content, multiColumn } } = this;
return <Component params={params} multiColumn={multiColumn}>{content}</Component>;
}
render () { render () {
const { component: Component, content, ...rest } = this.props; const { component: Component, content, ...rest } = this.props;

Loading…
Cancel
Save