diff --git a/src/mol-plugin/ui/plugin.tsx b/src/mol-plugin/ui/plugin.tsx index 598d5f26d386188d3bcb7061369bd6a5372c3271..9e1f84a230f7bf680ae368c8c79093060663f897 100644 --- a/src/mol-plugin/ui/plugin.tsx +++ b/src/mol-plugin/ui/plugin.tsx @@ -32,7 +32,8 @@ export class Plugin extends React.Component<{ plugin: PluginContext }, { }> { } export class _test_CurrentObject extends React.Component<{ plugin: PluginContext }, { }> { - componentWillMount() { + componentDidMount() { + // TODO: move to constructor? this.props.plugin.behaviors.state.data.currentObject.subscribe(() => this.forceUpdate()); } render() { diff --git a/src/mol-plugin/ui/state-tree.tsx b/src/mol-plugin/ui/state-tree.tsx index 7ad666396a3fd28332b28e5a525fd61f2041e541..f7dd468e2a24c82b03dc95b82d28dbfad96c379c 100644 --- a/src/mol-plugin/ui/state-tree.tsx +++ b/src/mol-plugin/ui/state-tree.tsx @@ -11,7 +11,8 @@ import { StateObject } from 'mol-state' import { PluginCommands } from 'mol-plugin/command'; export class StateTree extends React.Component<{ plugin: PluginContext }, { }> { - componentWillMount() { + componentDidMount() { + // TODO: move to constructor? this.props.plugin.events.state.data.updated.subscribe(() => this.forceUpdate()); } render() {