about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-07-08 18:34:55 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-07-08 18:34:55 +0200
commit91cacb1e8f9b2cb20a7cda2195b91d7d85c494e9 (patch)
treea703cecf3d6c43ab3c5df160f5546e376205c2e8 /app/javascript
parent46f5d3a2e95a2db7a8197929a7973259ad067a07 (diff)
fix: Rerender Bundle on route change (#4120)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/ui/util/react_router_helpers.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/app/javascript/mastodon/features/ui/util/react_router_helpers.js b/app/javascript/mastodon/features/ui/util/react_router_helpers.js
index e33a6df6f..ede578e56 100644
--- a/app/javascript/mastodon/features/ui/util/react_router_helpers.js
+++ b/app/javascript/mastodon/features/ui/util/react_router_helpers.js
@@ -31,13 +31,11 @@ export class WrappedRoute extends React.Component {
   }
 
   renderComponent = ({ match }) => {
-    this.match = match; // Needed for this.renderBundle
-
-    const { component } = this.props;
+    const { component, content, multiColumn } = this.props;
 
     return (
       <BundleContainer fetchComponent={component} loading={this.renderLoading} error={this.renderError}>
-        {this.renderBundle}
+        {Component => <Component params={match.params} multiColumn={multiColumn}>{content}</Component>}
       </BundleContainer>
     );
   }
@@ -50,12 +48,6 @@ export class WrappedRoute extends React.Component {
     return <BundleColumnError {...props} />;
   }
 
-  renderBundle = (Component) => {
-    const { match: { params }, props: { content, multiColumn } } = this;
-
-    return <Component params={params} multiColumn={multiColumn}>{content}</Component>;
-  }
-
   render () {
     const { component: Component, content, ...rest } = this.props;