Skip to content

Button background color does not update when switching themes on AndroidΒ #4570

@tonihm96

Description

@tonihm96

Current behaviour

On Android, when switching the provided theme between dark and light modes, the button's background color does not update.

Expected behaviour

The button's background color should update accordingly when the theme is switched between dark and light modes.

How to reproduce?

  1. Wrap your app with PaperProvider and provide a theme.
  2. Use React state to toggle between dark and light themes.

https://snack.expo.dev/@tonihm96/react-native-paper-button-background-color

Preview

screen-recording.mp4

What have you tried so far?

I created a wrapper Button component based on the one provided by the library and passed the desired background color via the contentStyle prop.

Your Environment

software version
ios unknown
android 14
react-native 0.76.3
react-native-paper 5.12.5
node 20.12.1
npm 10.8.2
expo sdk 52.0.14

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions