Click here to Skip to main content
15,559,682 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi Guys ,
I'm facing this issue :
TypeError: Cannot read property 'initialPreferences' of undefined

> 1 | import { Appearance } from 'react-native-appearance';
    | ^
  2 |
  3 | export const modedColor = (lightModeColor, darkModeColor) => {
  4 |   return Appearance.getColorScheme() === 'dark'

  at Object.<anonymous> (node_modules/react-native-appearance/lib/commonjs/index.tsx:15:1)
  at Object.<anonymous> (src/Core/helpers/colors.js:1:1)
  
Thanks you


What I have tried:

Tried mocking but not getting how to mock
Posted
Comments
Richard MacCutchan 31-Aug-21 4:11am    
You are trying to use a variable that has never been initialised.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900