Skip to content

undefined is not an object (evaluating '_reactNative.propTypes.object') #13502

Description

@Julianhm9612

My problem is the next:

undefined is not an object (evaluating '_reactNative.propTypes.object')

I'm using part of the react-native-material demo:

image

import React, { Component } from 'react';
import { PropTypes, View, Text, Image } from 'react-native';
import { Avatar, Drawer, Divider, COLOR, TYPO } from 'react-native-material-design';

export default class Navigation extends Component {
static contextTypes = {
drawer: PropTypes.object.isRequired,
navigator: PropTypes.object.isRequired
};
constructor(props) {
super(props);
this.state = {
route: null
}
}
changeScene = (path, name) => {
const { drawer, navigator } = this.context;
this.setState({
route: path
});
navigator.to(path, name);
drawer.closeDrawer();
};
render() {
const { route } = this.state;
return (

<Drawer.Header image={<Image source={require('./../img/nav.jpg')} />}>

<Avatar size={80} image={<Image source={{ uri: "http://facebook.github.io/react-native/img/opengraph.png?2" }}/>} />
<Text style={[styles.text, COLOR.paperGrey50, TYPO.paperFontSubhead]}>React Native Material Design

</Drawer.Header>

            <Drawer.Section
                items={[{
                    icon: 'home',
                    value: 'Welcome',
                    active: !route || route === 'welcome',
                    onPress: () => this.changeScene('welcome'),
                    onLongPress: () => this.changeScene('welcome')
                }]}
            />

            <Drawer.Section
                title="Components"
                items={[{
                    icon: 'face',
                    value: 'Avatars',
                    label: '12',
                    active: route === 'avatars',
                    onPress: () => this.changeScene('avatars'),
                    onLongPress: () => this.changeScene('avatars')
                },
                {
                    icon: 'label',
                    value: 'Subheaders',
                    label: '4',
                    active: route === 'subheaders',
                    onPress: () => this.changeScene('subheaders'),
                    onLongPress: () => this.changeScene('subheaders')
                }]}
            />
            <Divider style={{ marginTop: 8 }} />
            <Drawer.Section
                title="Config"
                items={[{
                    icon: 'invert-colors',
                    value: 'Change Theme',
                    label: '24',
                    active: route === 'themes',
                    onPress: () => this.changeScene('themes'),
                    onLongPress: () => this.changeScene('themes')
                }]}
            />
        </Drawer>
    );
}

}

const styles = {
header: {
paddingTop: 16
},
text: {
marginTop: 20
}
};

Why can it happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions