@@ -4,7 +4,7 @@ import { RootComp } from "comps/comps/rootComp";
44import { setGlobalSettings } from "comps/utils/globalSettings" ;
55import { sdkConfig } from "constants/sdkConfig" ;
66import _ from "lodash" ;
7- import { createRoot } from "react-dom/client" ;
7+ import { Root } from "react-dom/client" ;
88import { StyleSheetManager } from "styled-components" ;
99import { ModuleDSL , ModuleDSLIoInput } from "types/dsl" ;
1010import { AppView } from "./AppView" ;
@@ -40,7 +40,7 @@ export class AppViewInstance<I = any, O = any> {
4040 webUrl : "https://app.lowcoder.cloud" ,
4141 } ;
4242
43- constructor ( private appId : string , private node : Element , options : AppViewInstanceOptions = { } ) {
43+ constructor ( private appId : string , private node : Element , private root : Root , options : AppViewInstanceOptions = { } ) {
4444 Object . assign ( this . options , options ) ;
4545 if ( this . options . baseUrl ) {
4646 sdkConfig . baseURL = this . options . baseUrl ;
@@ -137,8 +137,7 @@ export class AppViewInstance<I = any, O = any> {
137137
138138 private async render ( ) {
139139 const data = await this . dataPromise ;
140- const root = createRoot ( this . node ) ;
141- root . render (
140+ this . root . render (
142141 < StyleSheetManager target = { this . node as HTMLElement } >
143142 < AppView
144143 appId = { this . appId }
0 commit comments