useDarkModeContext context.js:28:31
Closed this issue · 5 comments
fanzhiri commented
i have no idea where was go wrong .
i got a red Page , showing "Invariant Violation: Invalid hook call "
DimitarNestorov commented
What version of React Native are you using?
fanzhiri commented
What version of React Native are you using?
"react": "16.8.6",
"react-native": "0.60.5",
DimitarNestorov commented
Did you call the function inside a functional component?
fanzhiri commented
Did you call the function inside a functional component?
I don't have functional component .
myComponent extends Component
how to use react-native-dark-mode in myComponent ?
DimitarNestorov commented
The high level APIs are hooks which can only be called in functional
components. Read more about hooks here:
https://reactjs.org/docs/hooks-intro.html
If you don’t want to use them you can try the low level APIs mentioned at
the bottom of the README