akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.28k stars 951 forks source link

Docs: OverflowMenu 'data' prop type is instead 'items' #606

Closed Kejoku closed 5 years ago

Kejoku commented 5 years ago

In the documentation for the usage and API of the OverflowComponent, the data prop seems to be incorrect/legacy at the moment, instead its currently named items. A working usage sample is:


render () {
    let { menuVisible, selectedMenuIndex } = this.state
    let items = [{
        title: 'Item 1'
    }]
    return (
        <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
            <OverflowMenu
            onSelect={this.onSelect}
            visible={menuVisible}
            selectedIndex={selectedMenuIndex}
            onSelect={this.onSelect}
            items={items}
            />
        </View>
    )
}

Sorry it's not typescript

32penkin commented 5 years ago

Hi @Kejoku! Thanks, will be fixed.

32penkin commented 5 years ago

By the way, the right property is "data". So everything is correct in the documentation

artyorsh commented 5 years ago

I guess @Kejoku is using version 4.1, that exports items Try updating to the beta version :)

npm i react-native-ui-kitten@beta @eva-design/eva@beta

Kejoku commented 5 years ago

@artyorsh thanks for that, you're completely right. I didn't realize I'd locked the version to 4.1.0 😄