我在react-native中使用react-native-modal,当我在调试时,它工作得很好,但是当我试图在应用程序发布时切换它的时候,应用程序就冻结了,我不知道为什么会这样,在依赖项的repo中也没有发现这样的问题,在stackoverflow中也没有发现什么
这是我的package.json
"dependencies": {
"axios": "^0.18.0",
"i18n-js": "^3.1.0",
"moment": "^2.22.2",
"native-base": "^2.8.1",
"react": "16.6.1",
"react-native": "0.57.5",
"react-native-actionsheet": "^2.4.2",
"react-native-audio": "^4.2.2",
"react-native-checkbox": "^2.0.0",
"react-native-dropdownalert": "^3.7.0",
"react-native-firebase": "^5.1.1",
"react-native-gesture-handler": "^1.0.9",
"react-native-image-crop-picker": "^0.21.3",
"react-native-languages": "^3.0.2",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-textfield": "^0.12.0",
"react-native-modal": "^7.0.2",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-onesignal": "^3.2.8",
"react-native-opentok": "^2.1.0",
"react-native-sound": "^0.10.9",
"react-native-spinkit": "^1.1.1",
"react-native-splash-screen": "^3.1.1",
"react-native-stars": "^1.1.5",
"react-navigation": "^3.0.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.2",
"react-test-renderer": "16.6.1"
},这是我的modal.js
import React from 'react';
import Modals from 'react-native-modal';
const Modal = props => (
<Modals isVisible={ props.is_visible } onBackdropPress={ () => props.toggle_modal(false) }>
{ props.children }
</Modals>
)
export default Modal;下面是我如何使用它的一个示例
<TouchableOpacity onPress={ () => this.toggle_modal('is_change_language_modal_visible') } style={ styles.settings_item_container }>
<Text style={ styles.settings_item_label }> { i18n.t('change_language') } </Text>
</TouchableOpacity>
<Modal is_visible={ this.state.is_change_language_modal_visible } toggle_modal={ () => this.toggle_modal('is_change_language_modal_visible') }>
<ChangeLanguage
change_language={ this.change_language }
/>
</Modal>发布于 2019-01-22 02:50:20
安卓设备上的调试应用
您是否在使用logcat的设备上获得了一些输出
你可以在USB连接的设备上运行logcat,以获得更多反馈,了解应用程序退出的原因。Android-Studio可以作为logcat的很好的图形用户界面,但也有其他一些工具...至少使用adb logcat命令。
如何在Android中启动Logcat -Studio
如果您使用android-studio,请确保使用您的项目文件夹中的/android-Directory作为Project-Root (不要使用您的react-native-project-root !)。然后按SHIFT键三次打开Logcat并键入Logcat
IOS-Device上的调试应用程序
对于IOs,使用:xcrun instruments -s devices
你甚至可以用XCode这样打开它:
单击按钮Open Console
https://stackoverflow.com/questions/54293561
复制相似问题