-3
我找不到这里有什么问题:https://hastebin.com/fuwofavuso.scala(我不能在这里发布,我不想缩进所有行)。反应原生代码does not execute
import React, { Component} from 'react';
import { Text, View, StyleSheet, Image, TextInput, AppRegistry} from 'react-native';
import { Constants, BlurView } from 'expo';
export default class App extends Component {
render() {
return (
<View style={{ height: 200, width: 300 }}>
<InputText/>
</View>
);
}
}
class InputText extends Component {
constructor(props) {
super(props);
this.state = {
text: 'lel',
};
}
render() {
return (
<div>
<TextInput
onChangeText={(text) => this.setState({ text })}
value={this.state.text}
/>
<Text value={this.state.text}></Text>
</div>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
},
paragraph: {
margin: 24,
fontSize: 18,
fontWeight: 'bold',
textAlign: 'center',
color: '#34495e',
},
});
AppRegistry.registerComponent('Unknown Snack',() => InputText);
我的错误是:
不确定是不是一个对象评估_reactnative.appregistry.registerComponent()
我运行它世博小吃
*“不想缩进所有行”* - 突出显示代码并单击一个按钮太费力了? – JJJ
你如何运行它? – parohy
诚实的建议;当问别人寻求帮助时,你应该投入尽可能多的努力,作为回报。你已经把你的代码粘贴在一个链接后面,并且没有指出你已经做出了什么样的尝试来解决这个问题。所以我会给你一个同样努力的答案; “它看起来像你的AppRegistry组件导入不工作”。 – gravityplanx