Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Cannot read property 'initialMode' of undefined #24

Closed
rishimukherjee opened this issue Oct 7, 2019 · 4 comments
Closed

Cannot read property 'initialMode' of undefined #24

rishimukherjee opened this issue Oct 7, 2019 · 4 comments
Labels
invalid This doesn't seem right

Comments

@rishimukherjee
Copy link

rishimukherjee commented Oct 7, 2019

I am getting the following error:

Cannot read property 'initialMode' of undefined.

I am just importing

import { useDarkMode } from 'react-native-dark-mode';

then calling

const isDarkMode = useDarkMode();

It gives me this error. I am on React Native 0.60.4 and react-native-dark-mode 0.1.2.

@DimitarNestorov
Copy link
Contributor

DimitarNestorov commented Oct 7, 2019

That's strange. initialMode isn't pascal case. I need more information. Does this happen on Android only or on iOS only or both? If it's only iOS did you run pod install after npm install/yarn add?

@rishimukherjee
Copy link
Author

rishimukherjee commented Oct 7, 2019

Sorry, I updated it to camelCase. So, this error is in iOS and not in android.

After I saw your reply, I did a pod install and it worked. Do you want me to make a pull request to update the doc in the Readme for this?

@DimitarNestorov DimitarNestorov changed the title Cannot read property 'InitialMode' of undefined Cannot read property 'initialMode' of undefined Oct 7, 2019
@DimitarNestorov DimitarNestorov added the invalid This doesn't seem right label Oct 21, 2019
@cesargdm
Copy link

cesargdm commented Apr 4, 2020

I had to add your library to the transformIgnorePatterns since export was being unrecognized

Screen Shot 2020-04-04 at 14 52 10

Screen Shot 2020-04-04 at 14 47 37

@cesargdm
Copy link

cesargdm commented Apr 4, 2020

jestjs/jest#2550

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants