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

Add Support Section title in dropdown list #237

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
# Support SectionList in dropdown list

You just need to format your data as for a SectionList and add the "renderSectionHeader" porps

```javascript
const options = [
{
title: 'Pizza',
data: [
{
key: 'pizza1',
name: 'Name of Pizza n°1',
},
{
key: 'pizza2',
name: 'Name of Pizza n°2',
},
{
key: 'pizza3',
name: 'Name of Pizza n°3',
},
],
},
{
title: 'Burger',
data: [
{
key: 'burger1',
name: 'Name of Burger n°1',
},
{
key: 'burger2',
name: 'Name of Burger n°2',
},
{
key: 'burger3',
name: 'Name of Burger n°3',
},
],
},
];
```

```javascript
renderHeader = ({ section: { title } }) => (
<View>
<Text>{title}</Text>
</View>
)
```

```javascript
<ModalDropdown
renderSectionHeader={this.renderHeader}
options={options}
selectByKey="name"
selected="burger3"
renderRow={this.renderRow}
/>
```

# After it's same of fork

[![npm version](https://badge.fury.io/js/react-native-modal-dropdown.svg)](https://badge.fury.io/js/react-native-modal-dropdown)

# react-native-modal-dropdown
Expand Down
Loading