Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 无法解析React Native中的模块。错误_React Native - Fatal编程技术网

React native 无法解析React Native中的模块。错误

React native 无法解析React Native中的模块。错误,react-native,React Native,我无法成功提交我的申请。大约两周前它还在工作,但在我昨天和今天尝试运行它之后,我遇到了这个错误。我在snack.expo上遇到了这个错误,在cmd中运行exp start时也遇到了这个错误。虽然我成功地导入了这些依赖项,但它仍然不起作用。我以前所有的模块都在工作,我还没有对代码进行修改,所以我不知道现在出了什么问题 ] 从“React”导入React; 从“react native”导入{样式表、文本、视图、AppRegistry、TouchableOpacity、TextInput、图像};

我无法成功提交我的申请。大约两周前它还在工作,但在我昨天和今天尝试运行它之后,我遇到了这个错误。我在snack.expo上遇到了这个错误,在cmd中运行exp start时也遇到了这个错误。虽然我成功地导入了这些依赖项,但它仍然不起作用。我以前所有的模块都在工作,我还没有对代码进行修改,所以我不知道现在出了什么问题

]

从“React”导入React;
从“react native”导入{样式表、文本、视图、AppRegistry、TouchableOpacity、TextInput、图像};
从“react navigation”导入{DroperNavigator,DroperItems};//1.2.1
从“/Forecast.js”导入预测;
从“/Settings.js”导入设置;
从“力矩”中导入力矩;
从“本机基”导入{容器、头、体、内容};
//获取当前日期
让currentDate=新日期();
var newDate=时刻(日期(currentDate)).format('dddddd,MMMM DD-YYYY');
类计数扩展了React.Component{
状态={
stockAtStart:0,
库存编号:0,
}
render(){
返回(
{newDate}
开始
this.setState({text})}
style={[styles.boxContainer]}>
{this.state.stockAtStart}
结束
this.setState({text})}
style={[styles.boxContainer]}>
{this.state.stockAtEnd}
计数
);
}
}
常量CustomDrawerContentComponent=(道具)=>(
)
const styles=StyleSheet.create({
容器:{
弹性:1,
背景颜色:“#fff”,
差额:20,
},
boxContainerToggle:{
弹性:1,
为内容辩护:“中心”,
差额:20,
},
箱式集装箱:{
为内容辩护:“中心”,
},
第一箱:{
flex:1,//1:6
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#fff”,
},
方框二:{
flex:2,//2:6
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#cad0bc”,
},
方框三:{
flex:2,//2:6
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#a1a696”,
},
方框四:{
flex:1,//2:6
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“白色”,
边界半径:50,
边框宽度:0.5,
边框颜色:'#252525',
},
股票编号:{
字体大小:100,
fontWeight:'粗体',
textAlign:'中心',
颜色:“#34495e”,
},
第段:{
差额:24,
尺寸:27,
fontWeight:'粗体',
textAlign:'中心',
颜色:“#34495e”,
},
清单段落:{
fontWeight:'粗体',
textAlign:'中心',
对齐项目:'中心',
为内容辩护:“中心”,
颜色:'白色',
paddingTop:5,
},
当前日期:{
尺码:18,
fontWeight:'粗体',
paddingTop:40,
颜色:“#34495e”
},
付款人:{
身高:200,
宽度:200,
为内容辩护:“中心”,
对齐项目:“居中”,
},
校长日志:{
身高:120,
paddingLeft:30,
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#fff”
}
});
const appScreens=抽屉驱动程序({
计数:{屏幕:计数},
预测:{屏幕:预测},
设置:{屏幕:设置}
},{
initialRouteName:'计数',
contentComponent:CustomDrawerContentComponent,
DropeRopenRoute:“DropeRopen”,
抽屉关闭路线:“抽屉关闭”,
抽屉勾选:“抽屉勾选”
})
AppRegistry.registerComponent('CoCoFoForCast',()=>appScreens);
导出默认应用程序屏幕;

您可以发布一个指向您的零食的链接吗?
import React from 'react';
    import { StyleSheet, Text, View, AppRegistry, TouchableOpacity, TextInput, Image} from 'react-native';
    import { DrawerNavigator, DrawerItems } from 'react-navigation'; // 1.2.1
    import Forecast from './Forecast.js';
    import Settings from './Settings.js';
    import moment from 'moment';
    import {Container, Header, Body, Content} from 'native-base';


    //Get your current Date
    let currentDate = new Date();
    var newDate = moment(Date(currentDate)).format('dddd, MMMM DD YYYY');


    class Count extends React.Component {

      state = {
        stockAtStart: 0,
        stockAtEnd: 0,
      }

      render() {
        return (
          <View style={styles.container}>
            <View style={(styles.boxContainerToggle, styles.boxOne)}>
              <Text style={styles.currentDate}>{newDate}</Text>
            </View>

            <View style={[styles.boxContainerToggle, styles.boxTwo]}>
            <Text style={styles.inventoryParagraph}>start</Text>
            <View style={[styles.boxContainerToggle, styles.boxTwo]}>
                <TextInput
                underlineColorAndroid = 'transparent'
                returnKeyType = 'next'
                keyboardType = 'numeric'
                onChangeText={(text) => this.setState({text})}
                style={[styles.boxContainer]}>
                  <Text style={styles.stockNumber}>{this.state.stockAtStart}</Text>
                </TextInput>
            </View>
            </View>


             <View style={[styles.boxContainerToggle, styles.boxThree]}> 
             <Text style={styles.inventoryParagraph}>end</Text>
             <View style={[styles.boxContainerToggle, styles.boxThree]}>
                <TextInput
                underlineColorAndroid = 'transparent'
                returnKeyType = 'done'
                keyboardType = 'numeric'
                onChangeText={(text) => this.setState({text})}
                style={[styles.boxContainer]}>
                  <Text style={styles.stockNumber}>{this.state.stockAtEnd}</Text>
                </TextInput>
              </View>
              </View>

              <View style={[styles.boxContainerToggle, styles.boxFour]}>  
                <TouchableOpacity style={styles.boxContainer}>
                  <Text style={styles.paragraph}>COUNT</Text>
                </TouchableOpacity>
              </View>
            </View>
        );
      }
    }

    const CustomDrawerContentComponent = (props) => (
      <Container>
        <Header style={styles.headerLogo}>
          <Body>
            <Image
              style={styles.drawerLogo}
              source={require('./logo.png')}/>
          </Body>
        </Header>

        <Content>
          <DrawerItems {...props}/>
        </Content>
      </Container>
    )

    const styles = StyleSheet.create({
      container: {
        flex: 1,
        backgroundColor: '#fff',
        margin: 20,
      },

      boxContainerToggle: {
        flex: 1,
        justifyContent: 'center',
        margin: 20,


      },

      boxContainer: {
        justifyContent: 'center',

      },

      boxOne: {
        flex: 1, // 1:6
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#fff',


      },

      boxTwo: {
        flex: 2, // 2:6
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#cad0bc',
      },

       boxThree: {
        flex: 2, // 2:6
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#a1a696',

      },

       boxFour: {
        flex: 1, // 2:6
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'white',
        borderRadius: 50,
        borderWidth: 0.5,
        borderColor: '#252525',
      },
      stockNumber: {
        fontSize: 100,
        fontWeight: 'bold',
        textAlign: 'center',
        color: '#34495e',  
      },

      paragraph: {
        margin: 24,
        fontSize: 27,
        fontWeight: 'bold',
        textAlign: 'center',
        color: '#34495e',
      },

      inventoryParagraph: {
        fontWeight: 'bold',
        textAlign: 'center',
        alignItems:'center',
        justifyContent: 'center',
        color: 'white',
        paddingTop: 5,
      },

      currentDate: {
        fontSize: 18,
        fontWeight: 'bold',
        paddingTop: 40,
        color: '#34495e'

      },

      drawerLogo: {

        height: 200,
        width: 200,
        justifyContent: 'center',
        alignItems: 'center',


      },

      headerLogo:{
        height: 120,
        paddingLeft: 30,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#fff'
        }

    });


    const appScreens = DrawerNavigator({
      Count: { screen: Count },
      Forecast: { screen: Forecast },
      Settings: { screen: Settings }
    },{
      initialRouteName: 'Count',
      contentComponent: CustomDrawerContentComponent,
      drawerOpenRoute:  'DrawerOpen',
      drawerCloseRoute: 'DrawerClose',
      drawerToggleRoute: 'DrawerToggle'
      })

    AppRegistry.registerComponent('cocoforecast', () => appScreens);
    export default appScreens;