Skip to content

Commit 6a4c44f

Browse files
fix warning
1 parent a23de4b commit 6a4c44f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/src/pages/components/use-media-query/use-media-query.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,13 @@ You can reproduce the same behavior with a `useWidth` hook:
164164
- `options.defaultMatches` (*Boolean* [optional]):
165165
As `window.matchMedia()` is unavailable on the server,
166166
we return a default matches during the first mount. The default value is `false`.
167+
- `options.matchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia*. This can be used for handling an iframe content window.
167168
- `options.noSsr` (*Boolean* [optional]): Defaults to `false`.
168169
In order to perform the server-side rendering reconciliation, it needs to render twice.
169170
A first time with nothing and a second time with the children.
170171
This double pass rendering cycle comes with a drawback. It's slower.
171172
You can set this flag to `true` if you are **not doing server-side rendering**.
172-
- `options.ssrMatchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia*. This especially useful for [server-side rendering support](#server-side-rendering).
173+
- `options.ssrMatchMedia` (*Function* [optional]) You can provide your own implementation of *matchMedia* in a [server-side rendering context](#server-side-rendering).
173174

174175
Note: You can change the default options using the [`default props`](/customization/globals/#default-props) feature of the theme with the `MuiUseMediaQuery` key.
175176

packages/material-ui/src/useMediaQuery/useMediaQuery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function useMediaQuery(queryInput, options = {}) {
7676
active = false;
7777
queryList.removeListener(updateMatch);
7878
};
79-
}, [query, supportMatchMedia]);
79+
}, [query, matchMedia, supportMatchMedia]);
8080

8181
return match;
8282
}

0 commit comments

Comments
 (0)