File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ class Grid extends Component<Partial<Config>, any> {
1818 }
1919
2020 componentDidMount ( ) : void {
21+ // prevent gridjs from complaining that the container is not empty
22+ if ( this . wrapper . current . childNodes . length > 0 ) {
23+ this . wrapper . current . innerHTML = '' ;
24+ }
25+
2126 this . instance . render ( this . wrapper . current ) ;
2227 }
2328
Original file line number Diff line number Diff line change 11import { h , createRef as gCreateRef , Component as gComponent } from "gridjs" ;
2- import ReactDOM from "react-dom" ;
2+ import { createRoot } from "react-dom/client " ;
33
44
55export class ReactWrapper extends gComponent < {
@@ -13,7 +13,8 @@ export class ReactWrapper extends gComponent<{
1313 ref = gCreateRef ( ) ;
1414
1515 componentDidMount ( ) : void {
16- ReactDOM . render ( this . props . element , this . ref . current ) ;
16+ const root = createRoot ( this . ref . current ) ;
17+ root . render ( this . props . element ) ;
1718 }
1819
1920 render ( ) {
You can’t perform that action at this time.
0 commit comments