File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11import { Props , Search } from "./components/Search" ;
2- import * as ReactDOM from "react-dom/client" ;
3- import React from "react" ;
2+ import { createRoot , Root } from "react-dom/client" ;
3+ import { createElement } from "react" ;
44
55export class SearchUIHandler {
66 private props ! : Props ;
7- private root : ReactDOM . Root | null = null ;
7+ private root : Root | null = null ;
88 private isMounted = false ;
99
1010 public mount ( domNode : Element | DocumentFragment , props : Props ) {
1111 if ( ! this . isMounted ) {
12- this . root = ReactDOM . createRoot ( domNode ) ;
12+ this . root = createRoot ( domNode ) ;
1313 this . props = props ;
1414 this . render ( ) ;
1515 this . isMounted = true ;
1616 }
1717 }
1818
1919 private render ( ) {
20- const searchComponentInstance = React . createElement ( Search , this . props ) ;
20+ const searchComponentInstance = createElement ( Search , this . props ) ;
2121 this . root ?. render ( searchComponentInstance ) ;
2222 }
2323
You can’t perform that action at this time.
0 commit comments