[GH-ISSUE #250] Picker children.map not a function? #170

Closed
opened 2026-05-05 11:52:29 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @apollolux on GitHub (Jan 22, 2020).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/250

Describe the bug
Unable to npm run start using the example on main page (as of 2020-01-21 8:15 PM, US Eastern), gives the following error:

TypeError: children.map is not a function
    at children (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\components\PickerInternal.js:72:26)
    at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:19:25
    at Array.forEach (<anonymous>)
    at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:16:50
    at Array.forEach (<anonymous>)
    at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:9:27
    at Object.PickerInternal (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\components\PickerInternal.js:88:5)
    at Object.PICKERINTERNAL (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\createElement.js:15:59)
    at Object.createElement (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\createElement.js:19:28)
    at createInstance (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\reconciler\index.js:16:32)

To Reproduce
Init a project via proton-native , then replace the Example component definition with the one on the home page:

  render() {
    return (
      <App>
        <Window style={{ height: '50%', width: '10%' }}>
          <View>
            <Button title="Hello" onPress={() => console.log('Pressed')} />
            <Picker onValueChange={(i, text) => console.log(i, text)}>
              <Picker.Item label="Item1" value="i1" />
            </Picker>
          </View>
        </Window>
      </App>
    );
  }

...as well as importing the necessary components if missing.

Expected behavior
The program to build successfully and run.

Versions:

  • OS: Windows 10
  • Version proton-native-cli 0.0.7, proton-native 2.0.4
  • Node version 11.15.0

Additional context
Freshly generated example can run ok via npm run start

Originally created by @apollolux on GitHub (Jan 22, 2020). Original GitHub issue: https://github.com/kusti8/proton-native/issues/250 **Describe the bug** Unable to `npm run start` using the example on main page (as of 2020-01-21 8:15 PM, US Eastern), gives the following error: ``` TypeError: children.map is not a function at children (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\components\PickerInternal.js:72:26) at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:19:25 at Array.forEach (<anonymous>) at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:16:50 at Array.forEach (<anonymous>) at C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\propsUpdater.js:9:27 at Object.PickerInternal (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\components\PickerInternal.js:88:5) at Object.PICKERINTERNAL (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\createElement.js:15:59) at Object.createElement (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\utils\createElement.js:19:28) at createInstance (C:\Users\liqui\Documents\dev\lx-pq\node_modules\proton-native\bin\reconciler\index.js:16:32) ``` **To Reproduce** Init a project via `proton-native` , then replace the Example component definition with the one on the home page: ```react render() { return ( <App> <Window style={{ height: '50%', width: '10%' }}> <View> <Button title="Hello" onPress={() => console.log('Pressed')} /> <Picker onValueChange={(i, text) => console.log(i, text)}> <Picker.Item label="Item1" value="i1" /> </Picker> </View> </Window> </App> ); } ``` ...as well as importing the necessary components if missing. **Expected behavior** The program to build successfully and run. **Versions:** - OS: Windows 10 - Version proton-native-cli 0.0.7, proton-native 2.0.4 - Node version 11.15.0 **Additional context** Freshly generated example can run ok via `npm run start`
gitea-mirror 2026-05-05 11:52:29 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@apollolux commented on GitHub (Jan 22, 2020):

Seems adding a simple children && children.map existence guard can solve the problem :) Is a PR on that .ts file for that ok?

<!-- gh-comment-id:576973354 --> @apollolux commented on GitHub (Jan 22, 2020): Seems adding a simple `children && children.map` existence guard can solve the problem :) Is a PR on that .ts file for that ok?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#170
No description provided.