好像我不允许从 react-native-elements 导入 FormInput。
我收到了这个错误:
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `LoginForm`.
我的代码如下:
import React, { Component } from 'react'
import { Text, View } from 'react-native'
import { FormInput, Button } from 'react-native-elements'
export default class LoginForm extends Component {
render() {
return (
<View>
<FormInput value="" placeholder="Enter email"></FormInput>
<FormInput valye="" placeholder="Enter password"></FormInput>
<Button title="Login" backgroundColor="red"></Button>
</View>
)
}
}
我看不出我在做什么与官方文档不同。我知道 FormInput 是问题所在,因为如果我注释掉这两行,那么它会呈现得很好。