Fix webapp plugins for production builds (#7392)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
c68b866ef7
Коммит
e589accdaf
@@ -19,6 +19,10 @@ import PropTypes from 'prop-types';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export default class ProfilePopover extends React.Component {
|
export default class ProfilePopover extends React.Component {
|
||||||
|
static getComponentName() {
|
||||||
|
return 'ProfilePopover';
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ export default class Pluggable extends React.PureComponent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const childName = child.getComponentName();
|
||||||
|
|
||||||
// Include any props passed to this component or to the child component
|
// Include any props passed to this component or to the child component
|
||||||
let props = {...this.props};
|
let props = {...this.props};
|
||||||
Reflect.deleteProperty(props, 'children');
|
Reflect.deleteProperty(props, 'children');
|
||||||
@@ -40,8 +42,8 @@ export default class Pluggable extends React.PureComponent {
|
|||||||
props = {...props, ...this.props.children.props};
|
props = {...props, ...this.props.children.props};
|
||||||
|
|
||||||
// Override the default component with any registered plugin's component
|
// Override the default component with any registered plugin's component
|
||||||
if (components.hasOwnProperty(child.name)) {
|
if (components.hasOwnProperty(childName)) {
|
||||||
const PluginComponent = components[child.name];
|
const PluginComponent = components[childName];
|
||||||
return (
|
return (
|
||||||
<PluginComponent
|
<PluginComponent
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user