codemotionapps/react-native-dark-mode

useDarkMode() doesn't work on iOS 13.1.2

Closed this issue · 11 comments

In the new iOS 13.1.2, there's no toggle anymore.

I'm sorry but I don't understand you. Which toggle is missing?

I think what Tom is talking about is that on 13.1.2 your library suddenly stopped working for us. When the user toggles dark mode, it does not change. useDarkMode returns the wrong value.

Is there any reason why you use @available(iOS 13.0, *) checks instead of @available(iOS 13, *)? Maybe this is causing it?

It's not a 13.1.2 problem. It's a Xcode 11.1 problem. Thank you @apple, very cool.

Oh, is it? Do you know how to fix it yet? Or some kind of workaround?

I just verified that there is a problem, I'll need some time.

Actually there's a temporary solution. Don't use Xcode 11.1

My mistake, I wasn't testing properly. I'm currently running Xcode 11.1 GM and iOS 13.1.2 and I can't reproduce the issue. The "toggle" seems to be working fine. Can you share a tiny example or repo?

Nevermind. This was our fault. We've fixed it and you can close this issue now.

arled commented

This isn't working for me:
"react-native": "0.61.4",
iOS: 13.2.2
Xcode: Version 11.2.1 (11B500)

import { useDarkModeContext, useDarkMode } from 'react-native-dark-mode'

  const isDarkMode = useDarkMode()
  const mode = useDarkModeContext()

    console.log('isDarkMode ...', isDarkMode)
    console.log('mode ...', mode)

Always false and light.

mine was the opposite after toggling light and dark mode on my iphone's display settings
the app will always render dark mode as true, even closing and letting the app re-render doesn't work at the moment

+1