2017-03-21 5 views
-1

Ich starte ein reaktions-natives Projekt. Aber selbst nachdem ich dem besten Community-Code gefolgt bin, bekomme ich Fehler bei der Geräte-Emulation. Kannst du bitte helfen ?Appregistry Fehler reactive-native

import React, { Component } from 'react'; 
import { Appregistry, Text,View ,StyleSheet} from 'react-native'; 

import Compo from './app/app/Compo'; 

export default class test extends Component { 


render(){ 
    return(
    <View> 
     <Compo /> 
    </View> 
) 
} 
} 

const styles = StyleSheet.create({ 
container: { 
flex: 1, 
justifyContent: 'center', 
alignItems: 'center', 
backgroundColor: '#F5FCFF', 
}, 
welcome: { 
fontSize: 20, 
textAlign: 'center', 
margin: 10, 
}, 
instructions: { 
textAlign: 'center', 
color: '#333333', 
marginBottom: 5, 
}, 
}); 

AppRegistry.registerComponent ('test',() => test);


und meine namens App ist

import React, { Component } from 'react'; 
import { Appregistry,Text,View,StyleSheet } from 'react-native'; 


export default class Compo extends Component { 

render(){ 
    return(
    <View> 
     <Text>Hi Bineesh</Text> 
    </View> 
) 

} }

AppRegistry.registerComponent ('Compo',() => Compo);

Warum dies Fehler AppRegistry wirft?

+0

Was ist der Fehler? –

+0

@SagarKhatri kann Variable AppRegistry nicht finden – Bineesh

+0

Es ist ein Tippfehler in Ihrer Import-Anweisung. 'Appregistry = AppRegistry' –

Antwort

0

Javascript ist caseSensitive und das Wort Appregistry sollte als AppRegistry sein.