我最近弹出了我的react native expo应用程序,我试图在我的ios模拟器上启动它,但当我做react-native run-ios时,我得到这个错误。
这是我的RdvScreen.js代码。
import React from 'react';
import {View,Text,Button,StyleSheet,} from 'react-native'
import { ProgressSteps, ProgressStep } from 'react-native-progress-steps';
import Recap from './RécapitulatifScreen';
import MyComponent from '../Components/RadioButton';
import Identification from './IdentificationScreen';
class RDV extends React.Component {
render(){
return (
<View style={styles.container}>
<ProgressSteps>
<ProgressStep label="Identification " nextBtnText="Suivant" >
<Identification />
</ProgressStep>
<ProgressStep label=" Motif" nextBtnText="Suivant" previousBtnText="Précédent" >
<View style={{ alignItems: 'center' }}>
<MyComponent/>
</View>
</ProgressStep>
<ProgressStep label="Récapitulatif" nextBtnText="Suivant" previousBtnText="Précédent" >
<Recap/>
</ProgressStep>
<ProgressStep label="Confirmation" previousBtnText="Précédent" finishBtnText='Confirmer' onSubmit={()=> alert("Félicitation, votre rendez-vous est confirmé !")} >
<View style={{ alignItems: 'center' }}>
<Text>Confirmez votre rendez-vous</Text>
</View>
</ProgressStep>
</ProgressSteps>
</View>
);
}
}
我将感谢你的帮助
你需要修改两个文件。
screens -> RécapitulatifScreen改为RecapitulatifScreen。
打开屏幕文件夹下的RdvScreen.js,将第5行替换成
从'.RecapitulatifScreen'导入Recap。
肯定是封装器的问题
蛮力解决方案
watchman watch-del-all && rm -rf node_modules/ && npm cache clean --force&& npm install && npm start -- --reset-cache
或
npx react-native start --reset-cache