diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index d23d6488b6..53f2501f19 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -113,10 +113,12 @@ export default class PersistedElement extends React.Component { componentDidMount() { this.updateChild(); + this.renderApp(); } componentDidUpdate() { this.updateChild(); + this.renderApp(); } componentWillUnmount() { @@ -141,6 +143,14 @@ export default class PersistedElement extends React.Component { this.updateChildVisibility(this.child, true); } + renderApp() { + const content =
+ {this.props.children} +
; + + ReactDOM.render(content, getOrCreateContainer('mx_persistedElement_'+this.props.persistKey)); + } + updateChildVisibility(child, visible) { if (!child) return; child.style.display = visible ? 'block' : 'none'; @@ -160,12 +170,6 @@ export default class PersistedElement extends React.Component { } render() { - const content =
- {this.props.children} -
; - - ReactDOM.render(content, getOrCreateContainer('mx_persistedElement_'+this.props.persistKey)); - return
; } }