react-native-paper
react-native-paper copied to clipboard
Unable to change Drawer.Item - Divider theme
Current behaviour
Divider color is not changing based on theme
Expected behaviour
changing the outlineVariant value for theme should change the divider color.
How to reproduce?
Your Environment
| software | version |
|---|---|
| ios | 17.4 |
| react-native | 0.73.7 |
| react-native-paper | ^5.12.3 |
| node | 21.7.3 |
| npm or yarn | yarn |
| expo sdk | no |
Hey, I think is not a bug, looking at the material guides, is not common to change the Divider color in a Drawer. If this feature gains more visibility we will consider adding it into Drawer.Section, as a workaround you can do this:
<>
<Drawer.Section title="Some title" showDivider={false}>
<Drawer.Item
label="First Item"
active={active === 'first'}
onPress={() => setActive('first')}
/>
<Drawer.Item
label="Second Item"
active={active === 'second'}
onPress={() => setActive('second')}
/>
</Drawer.Section>
<Divider style={{backgroundColor: 'red'}} />
</>
```
hide the divider from `Drawer.Section` and add your own `Divider`.