Bin
2025-12-17 dcf780a91c16b6be28635b6e2e0e702060ee19f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Component } from "react";
import App from "./components/App/App";
import { configureStore } from "./configureStore";
 
export class LabelStudio extends Component {
  state = {
    initialized: false,
  };
 
  componentDidMount() {
    configureStore(this.props).then(({ store }) => {
      this.store = store;
      window.Htx = this.store;
      this.setState({ initialized: true });
    });
  }
 
  componentDidUpdate(prevProps) {
    if (this.props.task !== prevProps.task) {
      this.store.resetState();
      this.store.assignTask(this.props.task);
      this.store.initializeStore(this.props.task);
    }
  }
 
  render() {
    return this.state.initialized ? <App store={this.store} /> : null;
  }
}