-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.component: BoxThe React component.The React component.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUItype: bugIt doesn't behave as expected.It doesn't behave as expected.
Milestone
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
clone prop works perfectly fine in development. But when I saw the production build of the app, there styling is ignored which is applied by <Box clone/> component.
Steps to Reproduce 🕹
// BaseRouterLink
import React, { forwardRef } from "react";
import {
Link as RouterLink,
LinkProps as RouterLinkProps
} from "react-router-dom";
export default forwardRef<HTMLAnchorElement, RouterLinkProps>((props, ref) => (
<RouterLink innerRef={ref} {...props} />
));// <BackButton />
import React, { FC } from "react";
import IconButton, { IconButtonProps } from "@material-ui/core/IconButton";
import BackIcon from "@material-ui/icons/ArrowBackTwoTone";
import BaseRouterLink from "./Base/BaseRouterLink";
import Box from "@material-ui/core/Box";
type Props = IconButtonProps & {
to: string;
};
const BackButton: FC<Props> = ({ to }) => {
return (
<Box clone mb={2}>
<IconButton component={BaseRouterLink} color="primary" to={to}>
<BackIcon fontSize="small" />
</IconButton>
</Box>
);
};
export default BackButton;I attached some images to clarify the scenario with the above components.
Production Build:
margin-bottom is not applied to the button

Development Build:
margin-bottom is applied to the button

Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | ^4.6.1 |
| React | ^16.12.0 |
| Browser | Firefox v70 |
| TypeScript | ^3.7.2 |
| etc. |
I hope component order is not the problem
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.component: BoxThe React component.The React component.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUItype: bugIt doesn't behave as expected.It doesn't behave as expected.