aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/CategoryChooser.tsx
blob: 0f5d557f8733b9665b1ea1d1e09fd9c4d3acb01e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as React from "react";
import * as ReactDOM from "react-dom";
import CategoryChooserComponent from "../components/options/CategoryChooserComponent";

class CategoryChooser {

    ref: React.RefObject<CategoryChooserComponent>;

    constructor(element: Element) {
        this.ref = React.createRef();

        ReactDOM.render(
            <CategoryChooserComponent ref={this.ref} />,
            element
        );
    }

    update(): void {
        this.ref.current?.forceUpdate();
    }
}

export default CategoryChooser;