3

I am using react navigation's theme functionality to switch between dark and light mode and getting the colors for the mode with const { colors } = useTheme(); However I am trying to set colors in a stylesheet. How should I go about doing this. I have been doing {[styles.subtitle, colors.text]} to set styles on components. Is there a cleaner way to do this? Such as setting the color inside the styles.subtitle object?

bwees
  • 33
  • 4

1 Answers1

0

Make your stylesheet in the body of your component. Define const { colors } = useTheme(); and then directly beneath that (instead of at the bottom of the file), create your stylesheet

bwees
  • 33
  • 4