From 6a4c44f4b40e3bdd618d22c61a128b35b294ce51 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 9 Dec 2019 11:06:08 +0100 Subject: [PATCH] fix warning --- docs/src/pages/components/use-media-query/use-media-query.md | 3 ++- packages/material-ui/src/useMediaQuery/useMediaQuery.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/pages/components/use-media-query/use-media-query.md b/docs/src/pages/components/use-media-query/use-media-query.md index e1fa0ab49c7f22..ca29e673cd981e 100644 --- a/docs/src/pages/components/use-media-query/use-media-query.md +++ b/docs/src/pages/components/use-media-query/use-media-query.md @@ -164,12 +164,13 @@ You can reproduce the same behavior with a `useWidth` hook: - `options.defaultMatches` (*Boolean* [optional]): As `window.matchMedia()` is unavailable on the server, we return a default matches during the first mount. The default value is `false`. + - `options.matchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia*. This can be used for handling an iframe content window. - `options.noSsr` (*Boolean* [optional]): Defaults to `false`. In order to perform the server-side rendering reconciliation, it needs to render twice. A first time with nothing and a second time with the children. This double pass rendering cycle comes with a drawback. It's slower. You can set this flag to `true` if you are **not doing server-side rendering**. - - `options.ssrMatchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia*. This especially useful for [server-side rendering support](#server-side-rendering). + - `options.ssrMatchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia* in a [server-side rendering context](#server-side-rendering). Note: You can change the default options using the [`default props`](/customization/globals/#default-props) feature of the theme with the `MuiUseMediaQuery` key. diff --git a/packages/material-ui/src/useMediaQuery/useMediaQuery.js b/packages/material-ui/src/useMediaQuery/useMediaQuery.js index 3f21b04ff653c8..eda8ec7b38b5c2 100644 --- a/packages/material-ui/src/useMediaQuery/useMediaQuery.js +++ b/packages/material-ui/src/useMediaQuery/useMediaQuery.js @@ -76,7 +76,7 @@ function useMediaQuery(queryInput, options = {}) { active = false; queryList.removeListener(updateMatch); }; - }, [query, supportMatchMedia]); + }, [query, matchMedia, supportMatchMedia]); return match; }