Detect iPhone iOS Dark Mode w/ React Native

Viewed 10490

I know this is possible using Swift:

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    if traitCollection.userInterfaceStyle == .light {
        print("Light mode")
    } else {
        print("Dark mode")
    }
}

However, is there a way of doing this with JavaScript ?

2 Answers
Related