Quantcast
Viewing all articles
Browse latest Browse all 3

react-native fill the picker by mapping

on my RN project, I'm trying to fill my Picker by mapping from the state, which is an array. I consoled the object during mapping and it seems there isn't any problem, it shows the object that is being mapped. What I am doing wrong? Can you help me, please?

<Item>
                        <Picker
                                iosHeader="Select one"
                                mode="dropdown"
                                onValueChange={this.onBranchChange.bind(this)}>
                                {this.state.branchAddresses.map((address,i) =>
                                     {
                                         console.log("myAddresses: ",address);
                                         return <Item style={{fontFamily: 'SourceSansPro-Regular'}} label={address.id} value={address.id} key={i}/>}
                                )}
                            </Picker>
                        </Item>

And here is the snapshot of console.log().It writes the objects without any problem.Image may be NSFW.
Clik here to view.
enter image description here

Image may be NSFW.
Clik here to view.
enter image description here

Here is the warning that I get. Image may be NSFW.
Clik here to view.
enter image description here
Image may be NSFW.
Clik here to view.
enter image description here


Viewing all articles
Browse latest Browse all 3

Trending Articles