Skip to content

Commit 46869bc

Browse files
authored
[material-ui] Change React.ReactElement<any> to React.ReactElement<unknown> (#43402)
1 parent 0106a70 commit 46869bc

File tree

35 files changed

+54
-46
lines changed

35 files changed

+54
-46
lines changed

docs/data/material/components/app-bar/BackToTop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Props {
1616
* You won't need it on your project.
1717
*/
1818
window?: () => Window;
19-
children?: React.ReactElement<any>;
19+
children?: React.ReactElement<unknown>;
2020
}
2121

2222
function ScrollTop(props: Props) {

docs/data/material/components/app-bar/ElevateAppBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface Props {
1313
* You won't need it on your project.
1414
*/
1515
window?: () => Window;
16-
children?: React.ReactElement<any>;
16+
children?: React.ReactElement<{ elevation?: number }>;
1717
}
1818

1919
function ElevationScroll(props: Props) {

docs/data/material/components/app-bar/HideAppBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface Props {
1414
* You won't need it on your project.
1515
*/
1616
window?: () => Window;
17-
children?: React.ReactElement<any>;
17+
children?: React.ReactElement<unknown>;
1818
}
1919

2020
function HideOnScroll(props: Props) {

docs/data/material/components/autocomplete/Virtualize.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ const ListboxComponent = React.forwardRef<
5858
React.HTMLAttributes<HTMLElement>
5959
>(function ListboxComponent(props, ref) {
6060
const { children, ...other } = props;
61-
const itemData: React.ReactElement<any>[] = [];
62-
(children as React.ReactElement<any>[]).forEach(
63-
(item: React.ReactElement<any> & { children?: React.ReactElement<any>[] }) => {
61+
const itemData: React.ReactElement<unknown>[] = [];
62+
(children as React.ReactElement<unknown>[]).forEach(
63+
(
64+
item: React.ReactElement<unknown> & {
65+
children?: React.ReactElement<unknown>[];
66+
},
67+
) => {
6468
itemData.push(item);
6569
itemData.push(...(item.children || []));
6670
},
@@ -73,7 +77,7 @@ const ListboxComponent = React.forwardRef<
7377
const itemCount = itemData.length;
7478
const itemSize = smUp ? 36 : 48;
7579

76-
const getChildSize = (child: React.ReactElement<any>) => {
80+
const getChildSize = (child: React.ReactElement<unknown>) => {
7781
if (child.hasOwnProperty('group')) {
7882
return 48;
7983
}

docs/data/material/components/dialogs/FullScreenDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { TransitionProps } from '@mui/material/transitions';
1515

1616
const Transition = React.forwardRef(function Transition(
1717
props: TransitionProps & {
18-
children: React.ReactElement<any>;
18+
children: React.ReactElement<unknown>;
1919
},
2020
ref: React.Ref<unknown>,
2121
) {

docs/data/material/components/lists/InteractiveList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Typography from '@mui/material/Typography';
1616
import FolderIcon from '@mui/icons-material/Folder';
1717
import DeleteIcon from '@mui/icons-material/Delete';
1818

19-
function generate(element: React.ReactElement<any>) {
19+
function generate(element: React.ReactElement<unknown>) {
2020
return [0, 1, 2].map((value) =>
2121
React.cloneElement(element, {
2222
key: value,

docs/data/material/components/popper/SpringPopper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Popper from '@mui/material/Popper';
44
import { useSpring, animated } from '@react-spring/web';
55

66
interface FadeProps {
7-
children?: React.ReactElement<any>;
7+
children?: React.ReactElement<unknown>;
88
in?: boolean;
99
onEnter?: () => void;
1010
onExited?: () => void;

docs/data/material/components/rating/RadioGroupRating.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const StyledRating = styled(Rating)(({ theme }) => ({
1515

1616
const customIcons: {
1717
[index: string]: {
18-
icon: React.ReactElement<any>;
18+
icon: React.ReactElement<unknown>;
1919
label: string;
2020
};
2121
} = {

docs/data/material/components/steppers/CustomizedSteppers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const ColorlibStepIconRoot = styled('div')<{
146146
function ColorlibStepIcon(props: StepIconProps) {
147147
const { active, completed, className } = props;
148148

149-
const icons: { [index: string]: React.ReactElement<any> } = {
149+
const icons: { [index: string]: React.ReactElement<unknown> } = {
150150
1: <SettingsIcon />,
151151
2: <GroupAddIcon />,
152152
3: <VideoLabelIcon />,

docs/data/material/integrations/routing/ListRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Router(props: { children?: React.ReactNode }) {
2727
}
2828

2929
interface ListItemLinkProps {
30-
icon?: React.ReactElement<any>;
30+
icon?: React.ReactElement<unknown>;
3131
primary: string;
3232
to: string;
3333
}

0 commit comments

Comments
 (0)