react-native-picker-modal-view icon indicating copy to clipboard operation
react-native-picker-modal-view copied to clipboard

l.Name.toLocaleLowerCase

Open ChinmayDeyUI opened this issue 5 years ago • 2 comments

After I added your package in my project I got below error. TypeError: undefined is not an object (evaluating 'l.Name.toLocaleLowerCase')

When I used your top20.json it works, but if I used my own json I got above error. Your json is like [{"Name": "Åland Islands","Value": "Åland Islands","Code": "AX","Id": 1 }] and my json is like [{"id":1,"city":"Kolkata","type":"Metro","city_class":"A","state":"West Bengal","state_id":2,"type_id":"M"}]

ChinmayDeyUI avatar Jan 21 '20 05:01 ChinmayDeyUI

you must include Name key to your Json. sorry for my bad english

it look like : [{"Id":1,"Name":"Whatever"}]

Twelvefat avatar Jan 28 '20 08:01 Twelvefat

@ChinmayDeyUI You json is incorrect please use map function to convert json:

 var data = json.map((item) => {
    // item values can change, but no Id, Name, Value
     return {
        Id: item.Id,
        Name: item.city,
        Value: item.type,
     };
});

nericode avatar Nov 11 '20 23:11 nericode