1.坑之一
undefined is not an object (evaluating 'params.title')
Page2: {
screen: Page2,
navigationOptions: (props) => {
const {navigation} = props;
const {state, setParams} = navigation;
const {params} = state; //更改这个地方
return {
title: params.title ? params.title : 'This is Page3',
headerRight: (
<Button
title={params.mode === 'edit' ? '保存' : '编辑'}
onPress={() =>
setParams({
mode: params.mode === 'edit' ? '' : 'edit'
})
}
/>
)
}
}
},
改为:
const { params={} } = state;
2.坑之二
No bundle url present: when the React Packager tab is closed #14118

解决办法:
方法一:
info.plist → information Property List → + App Transport Security Settings → + Allow Arbitrary Loads = YES
方法二:
have found the easiest/quickest way to bypass this is to exit the app within the simulator (2 x Cmd + Shift + H) and re-launch.
网友评论