@shopify/react-hooks
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -8,4 +8,8 @@ # Changelog | ||
<!-- ## [Unreleased] --> | ||
## [Unreleased] | ||
### Fixed | ||
- Add missing `useMediaLayout` export ([#1408](https://github.com/Shopify/quilt/pull/1408)) | ||
## [1.9.0] - 2020-04-23 | ||
@@ -12,0 +16,0 @@ |
export { useDebouncedValue } from './debounced'; | ||
export { useInterval } from './interval'; | ||
export { useLazyRef } from './lazy-ref'; | ||
export { useMedia } from './media'; | ||
export { useMedia, useMediaLayout } from './media'; | ||
export { useMountedRef } from './mounted-ref'; | ||
@@ -6,0 +6,0 @@ export { useOnValueChange } from './on-value-change'; |
@@ -11,2 +11,3 @@ "use strict"; | ||
exports.useMedia = media_1.useMedia; | ||
exports.useMediaLayout = media_1.useMediaLayout; | ||
var mounted_ref_1 = require("./mounted-ref"); | ||
@@ -13,0 +14,0 @@ exports.useMountedRef = mounted_ref_1.useMountedRef; |
{ | ||
"name": "@shopify/react-hooks", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A collection of primitive React hooks.", |
@@ -117,6 +117,8 @@ # `@shopify/react-hooks` | ||
### `useMedia()` | ||
### `useMedia()` & `useMediaLayout()` | ||
This hook will listen to a [MediaQueryList](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList) created via [matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) and return true or false if it matches the media query string. | ||
`useMediaLayout` is similar to `useMedia` but it uses `useLayoutEffect` internally to re-render synchronously. | ||
```tsx | ||
@@ -123,0 +125,0 @@ function MyComponent() { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20845
228
204