Skip to content

Commit

Permalink
[system][useMediaQuery] Remove deprecated types (#42560)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jun 14, 2024
1 parent b51fd5d commit 4c46022
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
10 changes: 10 additions & 0 deletions docs/data/material/migration/migration-v5/migration-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,13 @@ We recommend adopting this new behavior and **not trying to replicate the old on
#### Contents wrapped in a <span>

The `children` passed to the LoadingButton component is now wrapped in a `<span>` tag to avoid [issues](https://github.com/mui/material-ui/issues/27853) when using tools to translate websites.

### useMediaQuery

#### Removed types

The following deprecated types were removed:

- `MuiMediaQueryList`: use `MediaQueryList` (from lib.dom.d.ts) instead.
- `MuiMediaQueryListEvent`: use `MediaQueryListEvent` (from lib.dom.d.ts) instead.
- `MuiMediaQueryListListener`: use `(event: MediaQueryListEvent) => void` instead.
21 changes: 0 additions & 21 deletions packages/mui-system/src/useMediaQuery/useMediaQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@ import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
import { getThemeProps } from '../useThemeProps';
import useTheme from '../useThemeWithoutDefault';

/**
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
*/
export interface MuiMediaQueryListEvent {
matches: boolean;
}

/**
* @deprecated Not used internally. Use `MediaQueryList` from lib.dom.d.ts instead.
*/
export interface MuiMediaQueryList {
matches: boolean;
addListener: (listener: MuiMediaQueryListListener) => void;
removeListener: (listener: MuiMediaQueryListListener) => void;
}

/**
* @deprecated Not used internally. Use `(event: MediaQueryListEvent) => void` instead.
*/
export type MuiMediaQueryListListener = (event: MuiMediaQueryListEvent) => void;

export interface UseMediaQueryOptions {
/**
* As `window.matchMedia()` is unavailable on the server,
Expand Down

0 comments on commit 4c46022

Please sign in to comment.