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

Picker undefined is not an object: child.props.value #2856

Closed
marcocesarato opened this issue Aug 8, 2019 · 3 comments · May be fixed by actionhero/actionhero-react-native-example#33
Closed
Assignees
Labels

Comments

@marcocesarato
Copy link

marcocesarato commented Aug 8, 2019

Issue Description

I am trying to return Picker.Item from an array but I face an error after upgrade from version 2.12.2 to 2.13.4 before works fine (with same code), this error is only on iOS in my case.

Version

Native base: 2.13.4
React Native: 0.60.4

Expected behaviour

Everything should render properly

Actual behaviour

Error screen error:

TypeError: undefined is not an object: (evaluating 'child.props.value')

Steps to reproduce

<Picker>
        <Picker.Item label="Item 0" value="0" />
        {this.state.data.map((values, key) => {
            return (<Picker.Item label={values.label} value={values.value} key={key}/>);
        })}
</Picker>

but this for example works:

<Picker>
        <Picker.Item label="Item 0" value="0" />
        <Picker.Item label="Item 1" value="1" />
</Picker>

Any other additional info which would help us debug the issue quicker.

Related issues closed: #983

@marcocesarato marcocesarato changed the title Picker undefined is not an object :child.props.value Picker undefined is not an object: child.props.value Aug 8, 2019
@marcocesarato
Copy link
Author

At the moment i found this workaround:

render {
    let data = this.state.data;
    data.unshift(<Picker.Item label="Item 0" value="0" />);
    return (
        <Picker>
            {data.map((values, key) => {
                return (<Picker.Item label={values.label} value={values.value} key={key}/>);
            })}
        </Picker>
    );
}

@PlabanJr
Copy link
Contributor

Please try our latest release v2.12.5.

@developer-gerejaku
Copy link

developer-gerejaku commented Sep 24, 2020

Hi , the bug it is'nt fixed yet i run some trouble on IOS , the picker behaviour is it can't accept empty or undefined data . Make sure you pass conditional data when the data is empty just pass empty array .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants