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
5
5
6
6
## [ 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)
7
7
8
-
9
8
### Bug Fixes
10
9
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 ) )
16
11
17
12
# [ 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)
18
13
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function Component() {
77
77
}
78
78
```
79
79
80
- Returns ** (` "no-preference" ` \| ` " light"` \| ` "dark" ` )** Preferred color scheme.
80
+ Returns ** (` "light" ` \| ` "dark" ` )** Preferred color scheme.
81
81
82
82
#### useDeviceMotion
83
83
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function Hook<T>({ callback }: HookProps<T>): JSX.Element {
13
13
return < > { JSON . stringify ( callback ( ) ) } </ > ;
14
14
}
15
15
16
- function renderHookToString < T > ( callback : ( ) => T ) : string {
16
+ function renderHookToString ( callback : ( ) => unknown ) : string {
17
17
return renderToString ( < Hook callback = { callback } /> ) ;
18
18
}
19
19
Original file line number Diff line number Diff line change @@ -11,14 +11,9 @@ import useMedia from './useMedia';
11
11
* // ...
12
12
* }
13
13
*/
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' {
19
15
const isDark = useMedia ( '(prefers-color-scheme: dark)' ) ;
20
16
21
- if ( isLight ) return 'light' ;
22
17
if ( isDark ) return 'dark' ;
23
- return 'no-preference ' ;
18
+ return 'light ' ;
24
19
}
You can’t perform that action at this time.
0 commit comments