未定义不是(评价“_reactNative.ViewPropTypes.style”)

未定义不是(评价“_reactNative.ViewPropTypes.style”)

问题描述:

说明 --- 当我克隆从GitHub一个项目,对象npm install react-native run-ios后,会出现以下错误:未定义不是一个对象(计算' _reactNative.ViewPropTypes.style')未定义不是(评价“_reactNative.ViewPropTypes.style”)

Here is the error screenshot

附加资料

  1. 反应母语-CLI:2.0.1
  2. 反应母语:0.44

我的主页的代码 -

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; 
+0

这是非常不可能的,以帮助没有你正在试图运行代码的更多信息。 –

+0

你需要什么信息? –

+0

你试图运行什么代码? –

通过更新本机基地2.1.4作为我的反应原生版本

解决误差为0.44

View.propTypes已被弃用,取而代之ViewPropTypes从RN44,这是在NativeBase的最新版本中引入以及使用。所以RN44去NativeBase v2.1.4和任何低于RN44,你可以使用NB V2.1.3

即与反应本地路由器通量的问题,您的react-native版本与react-native-router-flux的版本不兼容。 升级您的react-native-router-flux版本。 This可能会有所帮助。