Soon to be deprecated, it is recommended to use render
.
Used to start and mount App, usually not manually called. This API is only required when using Custom Bootstrap.
AppComponent
: The ReactElement instance created by createApp
.rootId
: DOM root element id to mount, such as "root"
.root
: The return value of ReactDOM.createRoot, used for scenarios where the root needs to be destroyed outside of the bootstrap function.ReactDOM
: The ReactDOM object, used to differentiate between React 18 and React 17 APIs.since @modern-js/runtime/plugins
is a alias, when used in a ts project, its type needs to be declared, Just add the following type declarations to src/modern-app-env.d.ts
:
bootstrap only supported for use in CSR.