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

[bugfix] Update PropTypes import statements to use wildcard syntax #43701

Closed
Closed
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
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Card from '@mui/material/Card';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ApiPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { ComponentApiContent, PropsTranslations } from '@mui-internal/api-docs-builder';
import exactProp from '@mui/utils/exactProp';
import Typography from '@mui/material/Typography';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ComponentsApiContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import kebabCase from 'lodash/kebabCase';
import { useRouter } from 'next/router';
import exactProp from '@mui/utils/exactProp';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/HooksApiContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import kebabCase from 'lodash/kebabCase';
import exactProp from '@mui/utils/exactProp';
import { Translate, useTranslate, useUserLanguage } from '@mui/docs/i18n';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

// empty props are likely a mistake.
// We want to make sure we catch this instead of keeping .propTypes
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/test-utils/src/components.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

/**
* A basic error boundary that can be used to assert thrown errors in render.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function getChained(type: PropTypeDescriptor) {
if (indexStart !== -1) {
const parsed = docgenParse(
`
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
const Foo = () => <div />
Foo.propTypes = {
bar: ${recast.print(recast.parse(type.raw).program.body[0].expression.arguments[0]).code}
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { useBadge } from '../useBadge';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { getButtonUtilityClass } from './buttonClasses';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import {
elementAcceptingRef,
exactProp,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { exactProp } from '@mui/utils';
import { DropdownProps } from './Dropdown.types';
import { DropdownContext } from '../useDropdown/DropdownContext';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/FocusTrap/FocusTrap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import {
exactProp,
elementAcceptingRef,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/FormControl/FormControl.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import useControlled from '@mui/utils/useControlled';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { FormControlContext } from './FormControlContext';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Input/Input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { createRenderer, fireEvent, screen, act } from '@mui/internal-test-utils';
import { expect } from 'chai';
import { spy } from 'sinon';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { isHostComponent } from '../utils/isHostComponent';
import { getInputUtilityClass } from './inputClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { HTMLElementType, refType } from '@mui/utils';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { MenuOwnerState, MenuProps, MenuRootSlotProps, MenuTypeMap } from './Menu.types';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/MenuButton/MenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { MenuButtonOwnerState, MenuButtonProps } from './MenuButton.types';
import { useSlotProps } from '../utils';
import { useMenuButton } from '../useMenuButton';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import {
MenuItemOwnerState,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
import { EventHandlers, useSlotProps } from '../utils';
import { useClassNamesOverride } from '../utils/ClassNameConfigurator';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/NoSsr/NoSsr.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
import { NoSsrProps } from './NoSsr.types';

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Option/Option.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { OptionProps, OptionOwnerState, OptionType, OptionRootSlotProps } from './Option.types';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/OptionGroup/OptionGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { getOptionGroupUtilityClass } from './optionGroupClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
unstable_useForkRef as useForkRef,
} from '@mui/utils';
import { createPopper, Instance, Modifier, Placement, State, VirtualElement } from '@popperjs/core';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { Portal } from '../Portal';
import { getPopperUtilityClass } from './popperClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Portal/Portal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import getReactNodeRef from '@mui/utils/getReactNodeRef';
import {
exactProp,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import {
SelectListboxSlotProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Slider/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import { chainPropTypes } from '@mui/utils';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Snackbar/Snackbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { ClickAwayListener } from '../ClickAwayListener';
import {
SnackbarOwnerState,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Switch/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { useSwitch } from '../useSwitch';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tab/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { getTabUtilityClass } from './tabClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/TabPanel/TabPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent, useSlotProps, WithOptionalOwnerState } from '../utils';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { getTabPanelUtilityClass } from './tabPanelClasses';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { fireEvent, createRenderer } from '@mui/internal-test-utils';
import {
TablePagination,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/TablePagination/TablePagination.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_useId as useId, chainPropTypes, integerPropType } from '@mui/utils';
import { PolymorphicComponent, useSlotProps, WithOptionalOwnerState } from '../utils';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { PolymorphicComponent, useSlotProps, WithOptionalOwnerState } from '../utils';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { getTabsUtilityClass } from './tabsClasses';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/TabsList/TabsList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '../composeClasses';
import { PolymorphicComponent, useSlotProps, WithOptionalOwnerState } from '../utils';
import { getTabsListUtilityClass } from './tabsListClasses';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import {
unstable_debounce as debounce,
unstable_useForkRef as useForkRef,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Transitions/CssAnimation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import { useTransitionStateManager } from '../useTransition';

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Transitions/CssTransition.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import { useTransitionStateManager } from '../useTransition';

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Unstable_NumberInput/NumberInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { OverridableComponent } from '@mui/types';
import { getNumberInputUtilityClass } from './numberInputClasses';
import { unstable_useNumberInput as useNumberInput } from '../unstable_useNumberInput';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Unstable_Popup/Popup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import {
autoUpdate,
flip,
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-docs/src/i18n/i18n.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { deepmerge } from '@mui/utils';
import defaultTranslations from '../translations';

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/AccordionDetails/AccordionDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/AccordionGroup/AccordionGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_capitalize as capitalize } from '@mui/utils';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/AccordionSummary/AccordionSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
import { useThemeProps } from '../styles';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/AspectRatio/AspectRatio.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
import { unstable_capitalize as capitalize } from '@mui/utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/Autocomplete/Autocomplete.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { expect } from 'chai';
import { spy } from 'sinon';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-joy/src/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import {
chainPropTypes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import { OverridableComponent } from '@mui/types';
import { unstable_capitalize as capitalize } from '@mui/utils';
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
Expand Down
Loading
Loading