开发服务响应错误代码500

时间:2019-06-22 08:43:47

标签: reactjs native

I am new to react native for navigation i am using react-native-router-flux but it returns an error => development server returned response error code 500 

I have uninstall and reinstall node modules
My react-native -v is 0.59.9
metro-react-native-babel-preset -v ^0.54.1
react-native-router-flux ^4.0.6


    login page
    import React, { Component } from 'react'
    import { Text, View, StyleSheet, TextInput, TouchableOpacity } from 'react-native'
    import { Actions } from 'react-native-router-flux'

    export default class Login extends Component {
        render() {
            return (
                <View style={styles.container}>
                    <View style={styles.header}>
                        <Text style={styles.headerText}>Sparow</Text>
                    </View>
                    <View style={styles.content}>
                        <TextInput style={styles.usernameInput} placeholder='Enter Your Username' placeholderTextColor='#fff' underlineColorAndroid='transparent' />
                        <TextInput style={styles.passwordInput} placeholder='Enter Your Password' placeholderTextColor='#fff' underlineColorAndroid='transparent' secureTextEntry={true} />
                        <TouchableOpacity style={styles.loginBtn} onPress={() => { Actions.Admin() }}>
                            <Text style={styles.loginBtnText}>Login</Text>
                        </TouchableOpacity>
                    </View>

                </View>
            )
        }
    }

admin page
import React, { Component } from 'react'
import { View, Text } from 'react-native'
export default class Admin extends Component {
    render() {
        return (
            <View>
                <Text>Admin Page</Text>
            </View>
        )
    }
}

路线页面

从'react'导入React,{组件} 从'react-native-router-flux'导入{Router,Scene} 从“ ../screen/登录”导入登录名 从“ ../screen/Admin”导入管理员

导出默认类Routes扩展Component {     render(){         返回(                                                                                                               )     } }

路由页面

从'react'导入React,{组件}; 从“ ./src/common/Routes”导入路由 导出默认类App扩展组件{   render(){     返回(             );   } }

0 个答案:

没有答案