@tarojs/runtime 3.3.17 → 3.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsl/react.d.ts +1 -1
- package/dist/runtime.esm.js +8 -8
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/dsl/react.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { AppInstance, ReactPageComponent, PageProps } from './instance';
|
|
|
5
5
|
export declare let R: typeof React;
|
|
6
6
|
export declare let PageContext: React.Context<string>;
|
|
7
7
|
export declare function connectReactPage(R: typeof React, id: string): (component: ReactPageComponent) => React.ComponentClass<PageProps>;
|
|
8
|
-
export declare function createReactApp(App: React.ComponentClass, react: typeof React,
|
|
8
|
+
export declare function createReactApp(App: React.ComponentClass, react: typeof React, dom: any, config: AppConfig): AppInstance;
|
|
9
9
|
export declare function createNativeComponentConfig(Component: any, react: typeof React, reactdom: any, componentConfig: any): {
|
|
10
10
|
properties: {
|
|
11
11
|
props: {
|
package/dist/runtime.esm.js
CHANGED
|
@@ -5511,9 +5511,10 @@ function setReconciler() {
|
|
|
5511
5511
|
}
|
|
5512
5512
|
}
|
|
5513
5513
|
const pageKeyId = incrementId();
|
|
5514
|
-
function createReactApp(App, react,
|
|
5514
|
+
function createReactApp(App, react, dom, config) {
|
|
5515
|
+
var _a;
|
|
5515
5516
|
R = react;
|
|
5516
|
-
ReactDOM =
|
|
5517
|
+
ReactDOM = dom;
|
|
5517
5518
|
ensure(!!ReactDOM, '构建 React/Nerv 项目请把 process.env.FRAMEWORK 设置为 \'react\'/\'nerv\' ');
|
|
5518
5519
|
const ref = R.createRef();
|
|
5519
5520
|
const isReactComponent = isClassComponent(R, App);
|
|
@@ -5555,8 +5556,7 @@ function createReactApp(App, react, reactdom, config) {
|
|
|
5555
5556
|
}
|
|
5556
5557
|
let wrapper;
|
|
5557
5558
|
if (!isBrowser) {
|
|
5558
|
-
|
|
5559
|
-
wrapper = ReactDOM.render(R.createElement(AppWrapper), document$2.getElementById('app'));
|
|
5559
|
+
wrapper = (_a = ReactDOM.render) === null || _a === void 0 ? void 0 : _a.call(ReactDOM, R.createElement(AppWrapper), document$2.getElementById('app'));
|
|
5560
5560
|
}
|
|
5561
5561
|
const app = Object.create({
|
|
5562
5562
|
render(cb) {
|
|
@@ -5580,11 +5580,11 @@ function createReactApp(App, react, reactdom, config) {
|
|
|
5580
5580
|
enumerable: true,
|
|
5581
5581
|
writable: true,
|
|
5582
5582
|
value(options) {
|
|
5583
|
+
var _a;
|
|
5583
5584
|
Current.router = Object.assign({ params: options === null || options === void 0 ? void 0 : options.query }, options);
|
|
5584
5585
|
if (isBrowser) {
|
|
5585
5586
|
// 由于 H5 路由初始化的时候会清除 app 下的 dom 元素,所以需要在路由初始化后执行 render
|
|
5586
|
-
|
|
5587
|
-
wrapper = ReactDOM.render(R.createElement(AppWrapper), document$2.getElementById('app'));
|
|
5587
|
+
wrapper = (_a = ReactDOM.render) === null || _a === void 0 ? void 0 : _a.call(ReactDOM, R.createElement(AppWrapper), document$2.getElementById((config === null || config === void 0 ? void 0 : config.appId) || 'app'));
|
|
5588
5588
|
}
|
|
5589
5589
|
const app = ref.current;
|
|
5590
5590
|
// For taroize
|
|
@@ -5939,7 +5939,7 @@ function createVueApp(App, vue, config) {
|
|
|
5939
5939
|
Current.router = Object.assign({ params: options === null || options === void 0 ? void 0 : options.query }, options);
|
|
5940
5940
|
if (isBrowser) {
|
|
5941
5941
|
// 由于 H5 路由初始化的时候会清除 app 下的 dom 元素,所以需要在路由初始化后再执行 render
|
|
5942
|
-
wrapper.$mount(document$2.getElementById('app'));
|
|
5942
|
+
wrapper.$mount(document$2.getElementById((config === null || config === void 0 ? void 0 : config.appId) || 'app'));
|
|
5943
5943
|
}
|
|
5944
5944
|
appInstance = wrapper.$refs.app;
|
|
5945
5945
|
if (appInstance != null && isFunction$1(appInstance.$options.onLaunch)) {
|
|
@@ -6083,7 +6083,7 @@ function createVue3App(app, h, config) {
|
|
|
6083
6083
|
var _a;
|
|
6084
6084
|
Current.router = Object.assign({ params: options === null || options === void 0 ? void 0 : options.query }, options);
|
|
6085
6085
|
if (isBrowser) {
|
|
6086
|
-
appInstance = app.mount('#app');
|
|
6086
|
+
appInstance = app.mount('#' + config.appId || 'app');
|
|
6087
6087
|
}
|
|
6088
6088
|
// 把 App Class 上挂载的额外属性同步到全局 app 对象中
|
|
6089
6089
|
// eslint-disable-next-line dot-notation
|