Skip to content

Commit

Permalink
[material-ui][docs] Fix issues reported by react-compiler in docs fol…
Browse files Browse the repository at this point in the history
…der (mui#42830)
  • Loading branch information
sai6855 authored and joserodolfofreitas committed Jul 29, 2024
1 parent e950f0c commit 5fdf4c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data/material/components/use-media-query/UseWidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function useWidth() {
const keys = [...theme.breakpoints.keys].reverse();
return (
keys.reduce((output, key) => {
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- useMediaQuery is called inside callback
// eslint-disable-next-line react-hooks/rules-of-hooks
const matches = useMediaQuery(theme.breakpoints.up(key));
return !output && matches ? key : output;
Expand Down
1 change: 1 addition & 0 deletions docs/data/material/components/use-media-query/UseWidth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function useWidth() {
const keys: readonly Breakpoint[] = [...theme.breakpoints.keys].reverse();
return (
keys.reduce((output: BreakpointOrNull, key: Breakpoint) => {
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- useMediaQuery is called inside callback
// eslint-disable-next-line react-hooks/rules-of-hooks
const matches = useMediaQuery(theme.breakpoints.up(key));
return !output && matches ? key : output;
Expand Down

0 comments on commit 5fdf4c6

Please sign in to comment.