Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Julianhm9612 opened this issue Apr 14, 2017 · 1 comment
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Julianhm9612
Copy link

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?

@hramos
Copy link
Contributor

hramos commented Apr 14, 2017

Hey, thanks for reporting this issue!

It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!

@hramos hramos closed this as completed Apr 14, 2017
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants