Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/Component.jsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 714 Bytes
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/Component.jsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/Component.jsx
-
curl -L -o Component.jsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/Component.jsx
714 Bytes
| 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; | |
| } | |
| } | |