2016-09-22 7 views
5

में घटकों फ़ोल्डर से जेएस फ़ाइलों तक कैसे पहुंचे मैं प्रतिक्रिया मूल परियोजना आईओएस में घटक फ़ोल्डर तक पहुंचने में असमर्थ हूं। http://caroaguilar.com/post/react-native-navigation-tutorial/प्रतिक्रिया मूल आईओएस प्रोजेक्ट

index.ios.js (ReactNativeProject/index.ios.js)

:

Unable to resolve module ./Login from ....../ReactNative/ReactNativeProject/components/App.js: Unable to find this module in its module map or any of the node_modules directories under ......./ReactNative/ReactNativeProject/components/Login.j and its parent directories.

मैं लिंक का पालन कहा जाता है:

मैं निम्न त्रुटि हो रही है

"use strict"; import React, { AppRegistry } from 'react-native'; import App from './components/App'; AppRegistry.registerComponent('ReactNativeProject',() => App); 

App.j रों (ReactNativeProject/घटकों/App.js)

'use strict' 

    import React, {Component} from 'react'; 
    import { 
     AppRegistry, 
     StyleSheet, 
     NavigatorIOS, 
    } from 'react-native'; 
    var Login = require('./Login'); 

    class App extends Component { 
     render() { 
      return (
       <NavigatorIOS 
       style={styles.navigationContainer} 
       initialRoute={{ 
       title: "Login Page", 
       component: Login, 
       }} /> 
     ); 
     } 
    } 

    var styles = StyleSheet.create({ 
     navigationContainer: { 
      flex: 1 
     } 
    }); 

    export default App; 

Login.js (ReactNativeProject/घटकों/Login.js)

"use strict"; 
    import React, {Component} from 'react'; 
    import { 
     StyleSheet, 
     Text, 
     TextInput 
    } from 'react-native'; 
    import Button from 'react-native-button'; 
    import styles from './login'; 


    class Login extends Component { 

     constructor(props) { 
      super(props); 
      this.state = { 
       username: "", 
       password: "", 

      }; 
     } 

     render() { 
      return (

       <View style={styles.container}> 
        <View style={styles.textContainer}> 
         <TextInput 
          style={styles.inputUsername} 
          placeholder="Enter email ID" 
          value={this.state.username} 
          clearButtonMode = 'while-editing'/> 
         <TextInput 
          style={styles.inputPassword} 
          placeholder="Enter Password" 
          value={this.state.password} 
          password={true} 
          secureTextEntry={true} 
          clearButtonMode = 'while-editing' /> 

        <Button style={styles.login} 
          styleDisabled={{color: 'red'}}> 
          Login 
         </Button> 
        </View> 
       </View> 
      ); 
     } 

    module.exports = Login; 

उत्तर

संबंधित मुद्दे