@wireapp/react-ui-kit
Advanced tools
Comparing version 9.20.0 to 9.21.0
@@ -9,3 +9,3 @@ import { ReactFragment } from 'react'; | ||
} | ||
export declare const useMatchMedia: (query: Query) => boolean; | ||
export declare const useMatchMedia: (query: Query, customWindowObj?: Window) => boolean; | ||
export declare const MatchMedia: React.FC<MatchMediaProps>; | ||
@@ -12,0 +12,0 @@ export type NamedMatchMediaProps = Omit<MatchMediaProps, 'query'>; |
@@ -25,4 +25,5 @@ "use strict"; | ||
const mediaQueries_1 = require("../mediaQueries"); | ||
const useMatchMedia = (query) => { | ||
const matchMedia = (0, react_1.useMemo)(() => window.matchMedia(`(${query})`), [query]); | ||
const useMatchMedia = (query, customWindowObj) => { | ||
const windowObj = customWindowObj || window; | ||
const matchMedia = (0, react_1.useMemo)(() => windowObj.matchMedia(`(${query})`), [query, windowObj]); | ||
const [isMatching, setIsMatching] = (0, react_1.useState)(matchMedia.matches); | ||
@@ -29,0 +30,0 @@ const updateMatching = (event) => { |
@@ -73,4 +73,4 @@ { | ||
}, | ||
"version": "9.20.0", | ||
"gitHead": "26fec94053cdc8ff69053a5dc8573bcdc30a8982" | ||
"version": "9.21.0", | ||
"gitHead": "7e564f4fdc36d52e58b224788b680ce41e577722" | ||
} |
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
686863
9964