1

When trying to assign the variable "theme" (which receives the useColorScheme library) as a style, the following error is presented.

Error image

Light and dark styles were created in styles.js.

Github Gist

Github project

Thank you very much in advance!

José Guilherme
  • 57
  • 1
  • 10

2 Answers2

0

I'm having the same issue, also noticing that if you try and import the Appearance component it comes in as null.

Using the simulator or Android emulator

Barranger Ridler
  • 880
  • 4
  • 17
  • I solved this error. useColorScheme belongs to 'react-native-appearance', not 'react-native'. It works both in the emulator and in the physical cell itself. – José Guilherme May 14 '20 at 03:31
0

useColorScheme belongs to 'react-native-appearance', not 'react-native'.

Example

import { useColorScheme } from 'react-native-appearance'
José Guilherme
  • 57
  • 1
  • 10