我在 React-Native 中的组件代码如下(请注意我使用的是 native-base,以防结构看起来很奇怪):
class CardIntInput extends React.Component {
render() {
return (
<Card>
<Form>
<Item regular>
<Label>
{this.props.info}:
</Label>
<Input
keyboardType = 'number-pad'
onChangeText = {(text) => {this.props.data} = text}
/>
</Item>
</Form>
</Card>
)
}
}
每次我运行代码时,它都会返回上述错误,我已将其隔离到 onChangeText 行。
我对 JS 和 React Native 很陌生,我已经尝试了所有我能想到的,所以我求助于其他人的建议。
我希望我只是忘记了一些简单的事情,但任何建议都将不胜感激