react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Unable to change Drawer.Item - Divider theme

Open grumpyTofu opened this issue 1 year ago • 1 comments

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?

image

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

grumpyTofu avatar May 02 '24 04:05 grumpyTofu

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`.

gedu avatar May 02 '24 10:05 gedu