React Native Expo应用TestFlight环境下Account组件点击崩溃求助
React Native Expo应用TestFlight安装后Account页面点击崩溃问题
我使用React Native Expo开发的应用已成功部署至Google Play Store,运行正常;在iOS模拟器及通过Expo调试的iOS真机上也能正常工作。
目前需要录制真机运行视频以提交App Store审核,通过TestFlight安装.ipa包后,在应用的Account页面点击某个组件选项时应用发生崩溃,无法定位原因。
以下是问题页面的代码:
const list = [ { title: "Mettre à jour mes informations", icon: "information-circle-sharp", clickon: "signOutHandler1", nameScreen: "UpdateAccount", }, { title: "Aide at assistance", icon: "help-circle", clickon: "signOutHandle4", nameScreen: "Help", }, { title: "Nous contacter", icon: "mail", clickon: "signOutHandler5", nameScreen: "Contact", }, { title: "Conditions générales d'utilisation", icon: "reader", clickon: "signOutHandler6", nameScreen: "TermsAndConditions", }, { title: "Déconnexion", icon: "log-out", clickon: "signOutHandler", nameScreen: "", }, ]; /** * Account screen * * @author [mamadou barry](alioufetowel@gmail.com) */ const AccountScreen = (props) => { /** * Error handling */ const [error, setError] = useState(); const [isLoading, setIsLoading] = useState(false); /** * Allow to call actions in order to update * The global state through redux */ const dispatch = useDispatch(); const loadFollowers = useCallback(async () => { setError(null); try { await dispatch(fetchFollowers()); } catch (err) { setError(err.message); } }, [dispatch, setError]); /** * Hangling error when it occur */ useEffect(() => { let mounted = true; setIsLoading(true); if (mounted && error) { console.log('Une erreur est survenue') } loadFollowers().then(() => { if (mounted) { setIsLoading(false); } }); return () => (mounted = false); }, [error, dispatch, loadFollowers]); const userInfos = useSelector((state) => state.auth); const userAbonnements = useSelector((state) => state.followers.abonnements); const userAbonnes = useSelector((state) => state.followers.abonnes); const userEvents = useSelector((state) => state.events.userEvents); /** * Logout the user */ const signOutHandler = async () => { setError(null); try { await dispatch(logout()); } catch (err) { setError(err.message); } }; onPressSubmitButton = (item) => { if (item.clickon === "signOutHandler") { return signOutHandler(); } else return props.navigation.navigate(item.nameScreen); }; if (!userInfos || isLoading) { return ( <View style={styles.centered}> <ActivityIndicator size="large" color={Colors.primary500} /> </View> ); } return ( <SafeAreaView style={styles.container}> <ScrollView> <View style={styles.optionAccount}> {list.map((item, i) => ( <ListItem key={i} bottomDivider onPress={() => onPressSubmitButton(item)} > <Ionicons name={item.icon} size={26} color={Colors.primary500} /> <ListItem.Content> <ListItem.Title>{item.title}</ListItem.Title> </ListItem.Content> <FontAwesome5 name="chevron-right" size={15} color={Colors.primary500} /> </ListItem> ))} </View> <Text style={styles.appVersion}> Version {app.expo.version} </Text> </ScrollView> </SafeAreaView> ); };
相关崩溃日志已留存,希望能得到排查帮助,感谢。
内容的提问来源于stack exchange,提问作者emile kaba
相关产品推荐
相关产品推荐

