Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui] Remove few more React.ReactElement<any> types #44290

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/material/components/modal/SpringModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Typography from '@mui/material/Typography';
import { useSpring, animated } from '@react-spring/web';

interface FadeProps {
children: React.ReactElement<any>;
children: React.JSX.Element;
in?: boolean;
onClick?: any;
onEnter?: (node: HTMLElement, isAppearing: boolean) => void;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/JoyThemeBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ function getAvailableTokens(colorSchemes: any, colorMode: 'light' | 'dark') {
return tokens;
}

function TemplatesDialog({ children, data }: { children: React.ReactElement<any>; data: any }) {
function TemplatesDialog({ children, data }: { children: React.JSX.Element; data: any }) {
const [open, setOpen] = React.useState(false);
const { map: templateMap } = sourceJoyTemplates();
const renderItem = (name: string, item: TemplateData) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface ClickAwayListenerProps {
/**
* The wrapped element.
*/
children: React.ReactElement<any>;
children: React.JSX.Element;
/**
* If `true`, the React tree is ignored and only the DOM tree is considered.
* This prop changes how portaled elements are handled.
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Modal/useModal.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type UseModalParameters = {
/**
* A single child content element.
*/
children: React.ReactElement<any> | undefined | null;
children: React.JSX.Element | undefined | null;
/**
* When set to true the Modal waits until a nested Transition is completed before closing.
* @default false
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Slider/SliderValueLabel.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface SliderValueLabelProps {
children?: React.ReactElement<any>;
children?: React.JSX.Element;
className?: string;
style?: React.CSSProperties;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface FocusTrapProps {
/**
* A single child content element.
*/
children: React.ReactElement<any>;
children: React.JSX.Element;
/**
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
* replace it to the last focused element when it closes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declare class ServerStyleSheets {
constructor(options?: object);
collect(children: React.ReactNode, options?: object): React.ReactElement<StylesProviderProps>;
toString(): string;
getStyleElement(props?: object): React.ReactElement<any>;
getStyleElement(props?: object): React.JSX.Element;
}

export default ServerStyleSheets;
2 changes: 1 addition & 1 deletion packages/mui-styles/test/styles.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ withStyles((theme) =>
});

interface ListItemContentProps extends WithStyles<typeof styles> {
children?: React.ReactElement<any>;
children?: React.ReactElement<unknown>;
inset?: boolean;
row?: boolean;
}
Expand Down