请我一直在尝试使用react-native元素框架,但我得到下面的错误,但当我删除导入非常正常工作,我尝试创建其他项目,但我仍然得到相同的错误,但作为我我删除导入后说,应用程序工作正常。
错误我
我的main.js
import React from 'react'
import {
StyleSheet,
Text,
View,
StatusBar,
TextInput,
TouchableHighlight,
TouchableOpacity
} from 'react-native';
import {Input,Icon} from 'react-native-elements';
//import { Container, Header, Content, Footer, FooterTab, Button, Text } from 'native-base';
export default class Main extends React.Component {
render() {
return (
<Input
placeholder='INPUT WITH ICON'
leftIcon={
<Icon
name='user'
size={24}
color='black'
/>
}
/>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'stretch',
justifyContent: 'flex-start',
paddingTop:20,
backgroundColor:'#aaa'
}
});
export default Main;
then my App.js
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {Provider} from 'react-redux';
import {configureStore} from './app/store';
import Main from './app/components/Main'
import { createStore, applyMiddleware } from 'redux';
import reducers from './app/reducer';
const store = createStore(reducers);
export default class App extends React.Component {
render() {
return (
<Provider store={configureStore()}>
<Main/>
</Provider>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
})
@Colin更新后
错误
答案 0 :(得分:0)
答案 1 :(得分:0)
感谢所有人,
我发现我的错误实际上我使用的文档是1.0.0,而我使用的节点版本是0.9版。谢谢