Buckets:
| ; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| exports.default = deleteLegacyGridProps; | |
| const getLegacyGridWarning = propName => { | |
| if (['item', 'zeroMinWidth'].includes(propName)) { | |
| return `The \`${propName}\` prop has been removed and is no longer necessary. You can safely remove it.`; | |
| } | |
| // #host-reference | |
| return `The \`${propName}\` prop has been removed. See https://mui.com/material-ui/migration/upgrade-to-grid-v2/ for migration instructions.`; | |
| }; | |
| const warnedAboutProps = []; | |
| /** | |
| * Deletes the legacy Grid component props from the `props` object and warns once about them if found. | |
| * | |
| * @param {object} props The props object to remove the legacy Grid props from. | |
| * @param {Breakpoints} breakpoints The breakpoints object. | |
| */ | |
| function deleteLegacyGridProps(props, breakpoints) { | |
| const propsToWarn = []; | |
| if (props.item !== undefined) { | |
| delete props.item; | |
| propsToWarn.push('item'); | |
| } | |
| if (props.zeroMinWidth !== undefined) { | |
| delete props.zeroMinWidth; | |
| propsToWarn.push('zeroMinWidth'); | |
| } | |
| breakpoints.keys.forEach(breakpoint => { | |
| if (props[breakpoint] !== undefined) { | |
| propsToWarn.push(breakpoint); | |
| delete props[breakpoint]; | |
| } | |
| }); | |
| if (process.env.NODE_ENV !== 'production') { | |
| propsToWarn.forEach(prop => { | |
| if (!warnedAboutProps.includes(prop)) { | |
| warnedAboutProps.push(prop); | |
| console.warn(`MUI Grid: ${getLegacyGridWarning(prop)}\n`); | |
| } | |
| }); | |
| } | |
| } |
Xet Storage Details
- Size:
- 1.49 kB
- Xet hash:
- 864c5dd24e0f6e81de416b111e0afe4e8a36d551c9deccc35e2871e7d473be24
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.