नया प्रतिक्रिया यहां मूल उपयोगकर्ता। मैं एक मुद्दे में भाग रहा हूं और मुझे यकीन नहीं है कि कैसे आगे बढ़ना है। मैं प्रतिक्रिया-नेविगेशन को ठीक से चलने में सक्षम था और फिर एक त्रुटि प्राप्त करना शुरू कर दिया: "मार्ग के लिए घटक ए रिएक्ट घटक होना चाहिए" लेकिन जब तक मुझे कुछ याद नहीं आ रहा है, मुझे विश्वास है कि जिस घटक का मैं संदर्भ कर रहा हूं एक प्रतिक्रिया घटक है । नीचे मेरी index.android.js और मेरे Home.js नीचे देखें:प्रतिक्रिया मूल नेविगेशन घटक मार्ग अंक
//index.android.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {
TabNavigator,
StackNavigator
} from 'react-navigation';
import Home from './app/components/Home/Home';
import Search from './app/components/Search/Search';
export default class demoApp extends Component {
render() {
return (
<SimpleNavigation/>
);
}
}
export const SimpleNavigation = StackNavigator({
Home: {
screen: Home,
header: { visible: false },
navigationOptions: {
title: 'Home',
header: null
},
},
Search: {
screen: Search,
navigationOptions: {
title: 'test'
},
},
},{});
//Home.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
TextInput,
Button,
TouchableHighlight
} from 'react-native';
class Home extends Component {
constructor(props){
super(props);
this.state = {zipCode: ''}
}
navigate = (zipCode) => {
this.props.navigation.navigate('Search', zipCode);
}
render() {
return (
<View style={styles.container}>
<View style={[styles.boxContainer, styles.boxOne]}>
<Image style={styles.logo} source {require('../../images/Logo.png')} />
<Text style={styles.title}>An application to do things</Text>
<TextInput
style={styles.textInput}
placeholder='Enter a Zip Code'
onChangeText={(zipCode) => this.setState({zipCode})}
>
</TextInput>
</View>
<View style={[styles.boxContainer, styles.boxTwo]}>
<TouchableHighlight onPress={() => this.navigate(this.state.zipCode)}>
<Text style={styles.searchBox}>
Search
</Text>
</TouchableHighlight>
</View>
</View>
);
}
}
किसी भी मदद/संकेत बहुत सराहना प्रतिक्रिया होती है। धन्यवाद!
कृपया अपनी पोस्ट में छवियों के लिए लिंक नहीं रख सकता हूं के अंत में
जोड़ने के लिए, लेकिन छवियों को सीधे डाल खुद को पोस्ट में। – MetaColon
हाँ मैं छवि लिंक जोड़ने के साथ समस्या को समझता हूं, क्षमा करें! मुझे नहीं लगता कि मेरे पास छवियों को एम्बेड करने के लिए अभी तक पर्याप्त प्रतिष्ठा है ... – saupton