-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Use react native 0.62 hook for dark mode (#21455)
- Loading branch information
Showing
2 changed files
with
2 additions
and
17 deletions.
There are no files selected for viewing
9 changes: 2 additions & 7 deletions
9
packages/compose/src/hooks/use-preferred-color-scheme/index.ios.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useDarkModeContext, eventEmitter } from 'react-native-dark-mode'; | ||
|
||
// Conditional needed to pass UI Tests on CI | ||
if ( eventEmitter.setMaxListeners ) { | ||
eventEmitter.setMaxListeners( 150 ); | ||
} | ||
import { useColorScheme } from 'react-native'; | ||
|
||
/** | ||
* Returns the color scheme value when it changes. Possible values: [ 'light', 'dark' ] | ||
* | ||
* @return {string} return current color scheme. | ||
*/ | ||
const usePreferredColorScheme = useDarkModeContext; | ||
const usePreferredColorScheme = useColorScheme; | ||
|
||
export default usePreferredColorScheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters