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

[core] Remove unused props clone #26992

Merged
merged 1 commit into from
Jun 28, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ const CalendarPicker = React.forwardRef(function CalendarPicker<TDate extends an
}
}, [date]); // eslint-disable-line

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ function PickersCalendarHeader<TDate>(props: PickersCalendarHeaderProps<TDate>)
return null;
}

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

return (
<PickersCalendarHeaderRoot styleProps={styleProps}>
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui-lab/src/ClockPicker/Clock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ function Clock<TDate>(props: ClockProps<TDate>) {
value,
} = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

const utils = useUtils<TDate>();
const wrapperVariant = React.useContext(WrapperVariantContext);
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui-lab/src/ClockPicker/ClockNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const ClockNumberRoot = styled('span', { skipSx: true })<{ styleProps: ClockNumb
*/
function ClockNumber(props: ClockNumberProps) {
const { className, disabled, index, inner, label, selected, ...other } = props;
// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

const angle = ((index % 12) / 12) * Math.PI * 2 - Math.PI / 2;
const length = ((CLOCK_WIDTH - CLOCK_HOUR_WIDTH - 2) / 2) * (inner ? 0.65 : 1);
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui-lab/src/ClockPicker/ClockPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ function ClockPicker<TDate>(inProps: ClockPickerProps<TDate>) {
selectedId,
]);

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const DatePickerToolbar = React.forwardRef<HTMLDivElement, ToolbarComponentProps
: utils.format(date, 'normalDate');
}, [date, toolbarFormat, toolbarPlaceholder, utils, views]);

const styleProps = { ...props };
const styleProps = props;

return (
<DatePickerToolbarRoot
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui-lab/src/MonthPicker/MonthPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ const MonthPicker = React.forwardRef(function MonthPicker<TDate>(
onMonthChange,
...other
} = props;
// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

const utils = useUtils<TDate>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const TimePickerToolbar: React.FC<ToolbarComponentProps> = (props) => {
const formatHours = (time: unknown) =>
ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');

const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses({ ...styleProps, theme });

const separator = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const TimelineConnector = React.forwardRef(function TimelineConnector(inProps, r

const { className, ...other } = props;

const styleProps = { ...props };
const styleProps = props;

const classes = useUtilityClasses(styleProps);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const TimelineSeparator = React.forwardRef(function TimelineSeparator(inProps, r

const { className, ...other } = props;

const styleProps = { ...props };
const styleProps = props;

const classes = useUtilityClasses(styleProps);

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/YearPicker/YearPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const YearPicker = React.forwardRef(function YearPicker<TDate>(
shouldDisableYear,
} = props;

const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

const now = useNow<TDate>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ const PickersArrowSwitcher = React.forwardRef(function PickersArrowSwitcher(
const rightArrowButtonProps = componentsProps.rightArrowButton || {};
const RightArrowIcon = components.RightArrowIcon || ArrowRightIcon;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

return (
<PickersArrowSwitcherRoot ref={ref} className={className} styleProps={styleProps} {...other}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ const PickersModalDialog = (props: React.PropsWithChildren<PickersModalDialogPro
todayText = 'Today',
} = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

return (
<PickersModalDialogRoot open={open} onClose={onDismiss} {...DialogProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ const PickersPopper = (props: PickerPopperProps) => {
const handleRef = useForkRef(paperRef, containerRef);
const handlePaperRef = useForkRef(handleRef, clickAwayRef as React.Ref<HTMLDivElement>);

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;

return (
<PickersPopperRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PickersToolbar = React.forwardRef<
viewType = 'calendar',
} = props;

const styleProps = { ...props };
const styleProps = props;

return (
<PickersToolbarRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const AccordionDetailsRoot = styled('div', {
const AccordionDetails = React.forwardRef(function AccordionDetails(inProps, ref) {
const props = useThemeProps({ props: inProps, name: 'MuiAccordionDetails' });
const { className, ...other } = props;
// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };

const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
4 changes: 1 addition & 3 deletions packages/material-ui/src/AlertTitle/AlertTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ const AlertTitle = React.forwardRef(function AlertTitle(inProps, ref) {

const { className, ...other } = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };

const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ const BottomNavigationAction = React.forwardRef(function BottomNavigationAction(
...other
} = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };

const styleProps = props;
const classes = useUtilityClasses(styleProps);

const touchStartPos = React.useRef();
Expand Down
4 changes: 1 addition & 3 deletions packages/material-ui/src/CardActionArea/CardActionArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ const CardActionArea = React.forwardRef(function CardActionArea(inProps, ref) {
const props = useThemeProps({ props: inProps, name: 'MuiCardActionArea' });
const { children, className, focusVisibleClassName, ...other } = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };

const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui/src/SnackbarContent/SnackbarContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ const SnackbarContentAction = styled('div', {
const SnackbarContent = React.forwardRef(function SnackbarContent(inProps, ref) {
const props = useThemeProps({ props: inProps, name: 'MuiSnackbarContent' });
const { action, className, message, role = 'alert', ...other } = props;
// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const SpeedDialIcon = React.forwardRef(function SpeedDialIcon(inProps, ref) {
const props = useThemeProps({ props: inProps, name: 'MuiSpeedDialIcon' });
const { className, icon: iconProp, open, openIcon: openIconProp, ...other } = props;

const styleProps = { ...props };
const styleProps = props;
const classes = useUtilityClasses(styleProps);

function formatIcon(icon, newClassName) {
Expand Down
4 changes: 1 addition & 3 deletions packages/material-ui/src/TablePagination/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ const TablePagination = React.forwardRef(function TablePagination(inProps, ref)
...other
} = props;

// TODO: convert to simple assignment after the type error in defaultPropsHandler.js:60:6 is fixed
const styleProps = { ...props };

const styleProps = props;
const classes = useUtilityClasses(styleProps);

const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
Expand Down