@@ -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() {
@@ -11,7 +11,8 @@ import { StateObject } from 'mol-state'
import { PluginCommands } from 'mol-plugin/command';
export class StateTree extends React.Component<{ plugin: PluginContext }, { }> {
this.props.plugin.events.state.data.updated.subscribe(() => this.forceUpdate());