appregistry del módulo no es un módulo invocable registrado (llamando a runApplication)
No puedo encontrar una manera de hacer que la navegación reactiva funcione. Copié los ejemplos de trabajo de Internet, pero tampoco parecen funcionar. alguien puede decirme que estoy haciendo mal.
estoy usando nodo: 8.9.4 reaccionar: 16.3.0-alpha.1 reaccionar nativo: 0.54.0 reaccionar-navegación: ^1.4.0
//index.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {
TabNavigator,
StackNavigator
} from 'react-navigation';
import Home from './first';
import Homes from './second';
export default class demoApp extends Component {
render() {
return (
<SimpleNavigation/>
);
}
}
export const SimpleNavigation = StackNavigator({
Home: {
screen: Home,
header: { visible: false },
navigationOptions: {
title: 'Home',
header: null
},
},
Homes: {
screen: Homes,
navigationOptions: {
title: 'second'
},
},
},{});
Aquí está la primera pestaña
//first.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
TextInput,
Button,
TouchableHighlight
} from 'react-native';
export default class Home extends Component {
constructor(props){
super(props);
this.state = {zipCode: ''}
}
navigate = (zipCode) => {
this.props.navigation.navigate('Search', zipCode);
}
render() {
return (
<View>
<View>
<Text>An application to do things</Text>
<TextInput
placeholder='Enter a Zip Code'
onChangeText={(zipCode) => this.setState({zipCode})}
>
</TextInput>
</View>
<View>
<TouchableHighlight onPress={() => this.navigate(this.state.zipCode)}>
<Text>
Search
</Text>
</TouchableHighlight>
</View>
</View>
);
}
}
Parece que no puedo hacerlo funcionar en absoluto. Intenté seguir muchos otros tutoriales también. Pero ninguno de ellos funcionó. ¿Qué estoy haciendo mal?
Mostrar la mejor respuesta