Skip to content

Commit

Permalink
feat(hippy-react): add callUIFunction debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj committed Jun 21, 2022
1 parent f61b48e commit 5944182
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/android-demo/res/index.android.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/android-demo/res/vendor.android.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions examples/ios-demo/res/index.ios.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/ios-demo/res/vendor.ios.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions packages/hippy-react/src/modules/ui-manager-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import { Fiber } from '@hippy/react-reconciler';
import { Bridge, Device, UIManager } from '../global';
import { getRootViewId, findNodeById, findNodeByCondition } from '../utils/node';
import { isFunction, warn } from '../utils';
import { isFunction, warn, trace } from '../utils';
import Element from '../dom/element-node';

const {
Expand Down Expand Up @@ -133,7 +133,7 @@ function callUIFunction(ref: Element | Fiber, funcName: string, ...options: any[
if (rootViewId === null) {
return;
}

trace('callUIFunction', { nodeId, funcName, paramList });
if (Device.platform.OS === 'ios') {
if (isFunction(callback) && Array.isArray(paramList)) {
paramList.push(callback);
Expand Down Expand Up @@ -170,6 +170,7 @@ function measureInWindowByMethod(
}
return reject(new Error(`${method} cannot get nodeId`));
}
trace('callUIFunction', { nodeId, funcName: method, paramList: [] });
return Bridge.callNative('UIManagerModule', method, nodeId, (layout: HippyTypes.LayoutEvent | string) => {
if (callback && isFunction(callback)) {
callback(layout);
Expand Down

0 comments on commit 5944182

Please sign in to comment.