File tree Expand file tree Collapse file tree 4 files changed +5
-15
lines changed
Expand file tree Collapse file tree 4 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
55
66## [ 3.0.1] ( https://github.com/kripod/react-hooks/compare/web-api-hooks@3.0.0...web-api-hooks@3.0.1 ) (2020-03-30)
77
8-
98### Bug Fixes
109
11- * bundle NetworkInformation properly ([ 2839251] ( https://github.com/kripod/react-hooks/commit/2839251e37ae6165bb3def0fea2d8f702cb86b86 ) )
12-
13-
14-
15-
10+ - bundle NetworkInformation properly ([ 2839251] ( https://github.com/kripod/react-hooks/commit/2839251e37ae6165bb3def0fea2d8f702cb86b86 ) )
1611
1712# [ 3.0.0] ( https://github.com/kripod/react-hooks/compare/web-api-hooks@2.2.2...web-api-hooks@3.0.0 ) (2020-03-30)
1813
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function Component() {
7777}
7878```
7979
80- Returns ** (` "no-preference" ` \| ` " light"` \| ` "dark" ` )** Preferred color scheme.
80+ Returns ** (` "light" ` \| ` "dark" ` )** Preferred color scheme.
8181
8282#### useDeviceMotion
8383
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function Hook<T>({ callback }: HookProps<T>): JSX.Element {
1313 return < > { JSON . stringify ( callback ( ) ) } </ > ;
1414}
1515
16- function renderHookToString < T > ( callback : ( ) => T ) : string {
16+ function renderHookToString ( callback : ( ) => unknown ) : string {
1717 return renderToString ( < Hook callback = { callback } /> ) ;
1818}
1919
Original file line number Diff line number Diff line change @@ -11,14 +11,9 @@ import useMedia from './useMedia';
1111 * // ...
1212 * }
1313 */
14- export default function useColorSchemePreference ( ) :
15- | 'no-preference'
16- | 'light'
17- | 'dark' {
18- const isLight = useMedia ( '(prefers-color-scheme: light)' ) ;
14+ export default function useColorSchemePreference ( ) : 'light' | 'dark' {
1915 const isDark = useMedia ( '(prefers-color-scheme: dark)' ) ;
2016
21- if ( isLight ) return 'light' ;
2217 if ( isDark ) return 'dark' ;
23- return 'no-preference ' ;
18+ return 'light ' ;
2419}
You can’t perform that action at this time.
0 commit comments