Javascript undefined不是对象(计算';(u reactNative.ViewPropTypes.style';))
说明--- 当我从github克隆项目时,在Javascript undefined不是对象(计算';(u reactNative.ViewPropTypes.style';)),javascript,reactjs,react-native,Javascript,Reactjs,React Native,说明--- 当我从github克隆项目时,在npm install react native run ios之后,会发生以下错误:undefined不是对象(评估'\u reactNative.ViewPropTypes.style') 其他信息 react本机cli:2.0.1 反应本机:0.44 我的代码主页- import React, {Component} from 'react'; import { StyleSheet } from 'react-native'; impo
npm install react native run ios
之后,会发生以下错误:undefined不是对象(评估'\u reactNative.ViewPropTypes.style')
其他信息
import React, {Component} from 'react';
import {
StyleSheet
} from 'react-native';
import { Actions } from 'react-native-router-flux';
import { Container, Header, Title, Button, Left, Right, Body, Icon } from 'native-base';
import Button1 from './Button';
import StreamStripContainer from '../containers/StreamStripContainer';
import StreamElementsContainer from '../containers/StreamElementsContainer';
class Stream extends Component {
render() {
return (
<Container style={{backgroundColor: '#F5F5F5'}} >
<Header>
<Left>
<Button transparent>
<Icon name='menu' />
</Button>
</Left>
<Body>
<Title>Stream</Title>
</Body>
<Right>
<Button transparent>
<Icon name='search' />
</Button>
</Right>
</Header>
<StreamStripContainer />
<StreamElementsContainer />
{/* <Button1 onPress={Actions.content} title='Go To Next Scene' /> */}
</Container>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F5F5F5'
}
});
export default Stream;
import React,{Component}来自'React';
进口{
样式表
}从“反应本机”;
从“react native router flux”导入{Actions};
从'native base'导入{容器、标题、标题、按钮、左、右、正文、图标};
从“./按钮”导入按钮1;
从“../containers/StreamStripContainer”导入StreamStripContainer;
从“../containers/StreamlementsContainer”导入Streamlements容器;
类流扩展组件{
render(){
返回(
流动
{/* */}
);
}
}
const styles=StyleSheet.create({
容器:{
背景颜色:“#F5”
}
});
导出默认流;
这是react native router flux的问题,您的react native版本与react native router flux版本不兼容。
升级您的react native router flux版本。
可能有帮助。通过将本机base更新为2.1.4解决了错误,因为我的react本机版本为0.44
不推荐使用View.propTypes,取而代之的是使用RN44中的ViewPropTypes,RN44也在最新版本的NativeBase中引入。因此,对于RN44,请选择NativeBase v2.1.4和低于RN44的任何版本,您可以使用NB v2.1.3如果没有关于您尝试运行的代码的更多信息,这是很难帮助您的。您需要什么信息?您尝试运行的代码是什么?