mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 22:47:18 +03:00
24 lines
560 B
TypeScript
24 lines
560 B
TypeScript
import * as React from "react";
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
import CategoryChooserComponent from "../components/options/CategoryChooserComponent";
|
|
|
|
class CategoryChooser {
|
|
|
|
ref: React.RefObject<CategoryChooserComponent>;
|
|
|
|
constructor(element: Element) {
|
|
this.ref = React.createRef();
|
|
|
|
const root = createRoot(element);
|
|
root.render(
|
|
<CategoryChooserComponent ref={this.ref} />
|
|
);
|
|
}
|
|
|
|
update(): void {
|
|
this.ref.current?.forceUpdate();
|
|
}
|
|
}
|
|
|
|
export default CategoryChooser; |