Skip to content

Commit 211f7a5

Browse files
authored
Merge pull request #2319 from didi/feat-catch-page-script
feat: 输出RN对页面script添加错误捕获处理
2 parents 977addb + 1e9cede commit 211f7a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/platform/createApp.ios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import transferOptions from '../core/transferOptions'
22
import builtInKeysMap from './patch/builtInKeysMap'
3-
import { makeMap, spreadProp, getFocusedNavigation, hasOwn } from '@mpxjs/utils'
3+
import { makeMap, spreadProp, getFocusedNavigation, hasOwn, callWithErrorHandling } from '@mpxjs/utils'
44
import { mergeLifecycle } from '../convertor/mergeLifecycle'
55
import { LIFECYCLE } from '../platform/patch/lifecycle/index'
66
import Mpx from '../index'
@@ -70,7 +70,7 @@ export default function createApp (options) {
7070
)
7171
}
7272
const getComponent = () => {
73-
return item.displayName ? item : item()
73+
return item.displayName ? item : callWithErrorHandling(item, null, 'require page script')
7474
}
7575
if (key === initialRouteName) {
7676
return createElement(Stack.Screen, {

0 commit comments

Comments
 (0)