diff options
Diffstat (limited to 'app/javascript/flavours/glitch/util/react_router_helpers.js')
-rw-r--r-- | app/javascript/flavours/glitch/util/react_router_helpers.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/util/react_router_helpers.js b/app/javascript/flavours/glitch/util/react_router_helpers.js index 1dba5e9bb..e36c512f3 100644 --- a/app/javascript/flavours/glitch/util/react_router_helpers.js +++ b/app/javascript/flavours/glitch/util/react_router_helpers.js @@ -35,14 +35,19 @@ export class WrappedRoute extends React.Component { component: PropTypes.func.isRequired, content: PropTypes.node, multiColumn: PropTypes.bool, + componentParams: PropTypes.object, } + static defaultProps = { + componentParams: {}, + }; + renderComponent = ({ match }) => { - const { component, content, multiColumn } = this.props; + const { component, content, multiColumn, componentParams } = this.props; return ( <BundleContainer fetchComponent={component} loading={this.renderLoading} error={this.renderError}> - {Component => <Component params={match.params} multiColumn={multiColumn}>{content}</Component>} + {Component => <Component params={match.params} multiColumn={multiColumn} {...componentParams}>{content}</Component>} </BundleContainer> ); } |