From 2a77a330230dfd534225a914b957cd591e7802c3 Mon Sep 17 00:00:00 2001 From: Daher Alfawares Date: Mon, 31 Oct 2022 06:28:53 -0700 Subject: [PATCH] [core] Enforce import * as React (#34878) --- .eslintrc.js | 18 ++++++++++++++---- .../snackbars/IntegrationNotistack.js | 2 +- .../snackbars/IntegrationNotistack.tsx | 2 +- .../gatsby-browser.js | 2 +- .../mui-base-with-tailwind-css/src/index.tsx | 2 +- examples/tailwind-css/src/index.tsx | 2 +- .../src/ButtonUnstyled/ButtonUnstyled.types.ts | 2 +- .../src/InputUnstyled/InputUnstyled.types.ts | 2 +- .../ListboxUnstyled/defaultListboxReducer.ts | 2 +- .../src/MenuUnstyled/MenuUnstyled.types.ts | 2 +- .../src/ModalUnstyled/ModalUnstyled.types.ts | 2 +- .../OptionGroupUnstyled.tsx | 2 +- .../OptionGroupUnstyled.types.ts | 2 +- .../src/OptionUnstyled/OptionUnstyled.tsx | 2 +- .../src/OptionUnstyled/OptionUnstyled.types.ts | 2 +- .../src/SelectUnstyled/useSelect.types.ts | 2 +- packages/mui-base/src/SelectUnstyled/utils.tsx | 2 +- .../src/SliderUnstyled/SliderUnstyled.types.ts | 2 +- .../src/SliderUnstyled/useSlider.types.ts | 2 +- .../SnackbarUnstyled/SnackbarUnstyled.types.ts | 2 +- .../src/SwitchUnstyled/useSwitch.test.tsx | 2 +- .../src/SwitchUnstyled/useSwitch.types.ts | 4 ++-- .../src/TabUnstyled/TabUnstyled.types.ts | 2 +- .../mui-base/src/TabUnstyled/useTab.types.ts | 2 +- .../TabsListUnstyled/TabsListUnstyled.types.ts | 2 +- .../src/TabsUnstyled/TabsUnstyled.types.ts | 2 +- packages/mui-base/src/utils/isHostComponent.ts | 2 +- .../mui-base/src/utils/useSlotProps.test.tsx | 2 +- .../actual-todo-comments.js | 2 +- .../expected-todo-comments.js | 2 +- packages/mui-joy/src/Button/ButtonProps.ts | 2 +- packages/mui-joy/src/Grid/GridProps.ts | 2 +- .../mui-joy/src/IconButton/IconButtonProps.ts | 2 +- packages/mui-joy/src/Input/InputProps.ts | 2 +- packages/mui-joy/src/Link/LinkProps.ts | 2 +- packages/mui-joy/src/Select/SelectProps.ts | 2 +- packages/mui-joy/src/Textarea/TextareaProps.ts | 2 +- .../src/Unstable_Grid2/Grid2Props.ts | 2 +- 38 files changed, 52 insertions(+), 42 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 292b16d11e4cb3..688076416ba460 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,5 @@ const path = require('path'); +const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style'); const forbidTopLevelMessage = [ 'Prefer one level nested imports to avoid bundling everything in dev mode', @@ -19,10 +20,10 @@ module.exports = { node: true, }, extends: [ - 'plugin:import/recommended', - 'plugin:import/typescript', - 'airbnb-typescript', - 'prettier', + 'plugin:eslint-plugin-import/recommended', + 'plugin:eslint-plugin-import/typescript', + 'eslint-config-airbnb-typescript', + 'eslint-config-prettier', ], parser: '@typescript-eslint/parser', parserOptions: { @@ -161,6 +162,15 @@ module.exports = { 'react/static-property-placement': 'off', // Currently not in recommended ruleset but catches real bugs. 'react/no-unstable-nested-components': 'error', + 'no-restricted-syntax': [ + // See https://github.com/eslint/eslint/issues/9192 for why it's needed + ...baseStyleRules['no-restricted-syntax'], + { + message: + "Do not import default from React. Use a namespace import (import * as React from 'react';) instead.", + selector: 'ImportDeclaration[source.value="react"] ImportDefaultSpecifier', + }, + ], }, overrides: [ { diff --git a/docs/data/material/components/snackbars/IntegrationNotistack.js b/docs/data/material/components/snackbars/IntegrationNotistack.js index ae0c90dd2cbda3..c74275de543c1c 100644 --- a/docs/data/material/components/snackbars/IntegrationNotistack.js +++ b/docs/data/material/components/snackbars/IntegrationNotistack.js @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Button from '@mui/material/Button'; import { SnackbarProvider, useSnackbar } from 'notistack'; diff --git a/docs/data/material/components/snackbars/IntegrationNotistack.tsx b/docs/data/material/components/snackbars/IntegrationNotistack.tsx index 06573c9c1f318f..0f4ffa9baaf149 100644 --- a/docs/data/material/components/snackbars/IntegrationNotistack.tsx +++ b/docs/data/material/components/snackbars/IntegrationNotistack.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Button from '@mui/material/Button'; import { SnackbarProvider, VariantType, useSnackbar } from 'notistack'; diff --git a/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-browser.js b/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-browser.js index f61e0f298f8bb3..e2e89a449f21ff 100644 --- a/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-browser.js +++ b/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-browser.js @@ -1,5 +1,5 @@ /* eslint-disable import/prefer-default-export */ -import React from 'react'; +import * as React from 'react'; import { CacheProvider } from '@emotion/react'; import getEmotionCache from './getEmotionCache'; diff --git a/examples/mui-base-with-tailwind-css/src/index.tsx b/examples/mui-base-with-tailwind-css/src/index.tsx index 7f424747fb5ee9..ebf0aa4b05407b 100644 --- a/examples/mui-base-with-tailwind-css/src/index.tsx +++ b/examples/mui-base-with-tailwind-css/src/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; diff --git a/examples/tailwind-css/src/index.tsx b/examples/tailwind-css/src/index.tsx index 09bc4156abe4cd..e5248f74178aed 100644 --- a/examples/tailwind-css/src/index.tsx +++ b/examples/tailwind-css/src/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { createRoot } from 'react-dom/client'; import { createTheme, StyledEngineProvider, ThemeProvider } from '@mui/material/styles'; import { CssBaseline } from '@mui/material'; diff --git a/packages/mui-base/src/ButtonUnstyled/ButtonUnstyled.types.ts b/packages/mui-base/src/ButtonUnstyled/ButtonUnstyled.types.ts index 0a77cb87f78d26..28ad59b7e07f3c 100644 --- a/packages/mui-base/src/ButtonUnstyled/ButtonUnstyled.types.ts +++ b/packages/mui-base/src/ButtonUnstyled/ButtonUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps, Simplify } from '@mui/types'; import { UseButtonParameters, UseButtonRootSlotProps } from './useButton.types'; import { SlotComponentProps } from '../utils'; diff --git a/packages/mui-base/src/InputUnstyled/InputUnstyled.types.ts b/packages/mui-base/src/InputUnstyled/InputUnstyled.types.ts index a9e20922507b37..d72db2b55524cf 100644 --- a/packages/mui-base/src/InputUnstyled/InputUnstyled.types.ts +++ b/packages/mui-base/src/InputUnstyled/InputUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps, Simplify } from '@mui/types'; import { FormControlUnstyledState } from '../FormControlUnstyled'; import { UseInputParameters, UseInputRootSlotProps } from './useInput.types'; diff --git a/packages/mui-base/src/ListboxUnstyled/defaultListboxReducer.ts b/packages/mui-base/src/ListboxUnstyled/defaultListboxReducer.ts index d5894e6d955b40..d9341ca2c8ff71 100644 --- a/packages/mui-base/src/ListboxUnstyled/defaultListboxReducer.ts +++ b/packages/mui-base/src/ListboxUnstyled/defaultListboxReducer.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ListboxState, UseListboxPropsWithDefaults, diff --git a/packages/mui-base/src/MenuUnstyled/MenuUnstyled.types.ts b/packages/mui-base/src/MenuUnstyled/MenuUnstyled.types.ts index df7bc8df461c9c..d6cb68dc3237b4 100644 --- a/packages/mui-base/src/MenuUnstyled/MenuUnstyled.types.ts +++ b/packages/mui-base/src/MenuUnstyled/MenuUnstyled.types.ts @@ -1,5 +1,5 @@ import { OverrideProps } from '@mui/types'; -import React from 'react'; +import * as React from 'react'; import PopperUnstyled, { PopperUnstyledProps } from '../PopperUnstyled'; import { SlotComponentProps } from '../utils'; import { UseMenuListboxSlotProps } from './useMenu.types'; diff --git a/packages/mui-base/src/ModalUnstyled/ModalUnstyled.types.ts b/packages/mui-base/src/ModalUnstyled/ModalUnstyled.types.ts index 079ad5241e41ea..14ca670a16e3aa 100644 --- a/packages/mui-base/src/ModalUnstyled/ModalUnstyled.types.ts +++ b/packages/mui-base/src/ModalUnstyled/ModalUnstyled.types.ts @@ -1,5 +1,5 @@ import { OverridableComponent, OverridableTypeMap, OverrideProps } from '@mui/types'; -import React from 'react'; +import * as React from 'react'; import { PortalProps } from '../Portal'; import { SlotComponentProps } from '../utils'; import { ModalUnstyledClasses } from './modalUnstyledClasses'; diff --git a/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.tsx b/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.tsx index 4096b4df065392..78c9633815d2b9 100644 --- a/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.tsx +++ b/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import { OverridableComponent } from '@mui/types'; import composeClasses from '../composeClasses'; diff --git a/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.types.ts b/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.types.ts index 4e66e0a5b03013..bd6b804b92473d 100644 --- a/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.types.ts +++ b/packages/mui-base/src/OptionGroupUnstyled/OptionGroupUnstyled.types.ts @@ -1,5 +1,5 @@ import { OverrideProps } from '@mui/types'; -import React from 'react'; +import * as React from 'react'; import { SlotComponentProps } from '../utils'; export interface OptionGroupUnstyledComponentsPropsOverrides {} diff --git a/packages/mui-base/src/OptionUnstyled/OptionUnstyled.tsx b/packages/mui-base/src/OptionUnstyled/OptionUnstyled.tsx index 297a89c379e410..6bb069f7edcaf9 100644 --- a/packages/mui-base/src/OptionUnstyled/OptionUnstyled.tsx +++ b/packages/mui-base/src/OptionUnstyled/OptionUnstyled.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import { unstable_useForkRef as useForkRef } from '@mui/utils'; import { OptionState } from '../ListboxUnstyled'; diff --git a/packages/mui-base/src/OptionUnstyled/OptionUnstyled.types.ts b/packages/mui-base/src/OptionUnstyled/OptionUnstyled.types.ts index 21cb4ab64dd2a9..2123815ab0e3bc 100644 --- a/packages/mui-base/src/OptionUnstyled/OptionUnstyled.types.ts +++ b/packages/mui-base/src/OptionUnstyled/OptionUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { DefaultComponentProps, OverrideProps, Simplify } from '@mui/types'; import { OptionState } from '../ListboxUnstyled'; import { UseSelectOptionSlotProps } from '../SelectUnstyled/useSelect.types'; diff --git a/packages/mui-base/src/SelectUnstyled/useSelect.types.ts b/packages/mui-base/src/SelectUnstyled/useSelect.types.ts index f986878666d82d..35f43fa99dda1a 100644 --- a/packages/mui-base/src/SelectUnstyled/useSelect.types.ts +++ b/packages/mui-base/src/SelectUnstyled/useSelect.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { UseButtonRootSlotProps } from '../ButtonUnstyled'; import { OptionState, diff --git a/packages/mui-base/src/SelectUnstyled/utils.tsx b/packages/mui-base/src/SelectUnstyled/utils.tsx index 993a163dce4cc8..daeaaa1d0089ea 100644 --- a/packages/mui-base/src/SelectUnstyled/utils.tsx +++ b/packages/mui-base/src/SelectUnstyled/utils.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OptionUnstyledProps } from '../OptionUnstyled'; import { OptionGroupUnstyledProps } from '../OptionGroupUnstyled'; import { isOptionGroup, SelectChild, SelectOption, SelectOptionGroup } from './useSelect.types'; diff --git a/packages/mui-base/src/SliderUnstyled/SliderUnstyled.types.ts b/packages/mui-base/src/SliderUnstyled/SliderUnstyled.types.ts index 734b3896152643..692f6891e2606b 100644 --- a/packages/mui-base/src/SliderUnstyled/SliderUnstyled.types.ts +++ b/packages/mui-base/src/SliderUnstyled/SliderUnstyled.types.ts @@ -1,5 +1,5 @@ import { OverridableComponent, OverridableTypeMap, OverrideProps } from '@mui/types'; -import React from 'react'; +import * as React from 'react'; import { SlotComponentProps } from '../utils'; import { SliderUnstyledClasses } from './sliderUnstyledClasses'; import SliderValueLabelUnstyled from './SliderValueLabelUnstyled'; diff --git a/packages/mui-base/src/SliderUnstyled/useSlider.types.ts b/packages/mui-base/src/SliderUnstyled/useSlider.types.ts index 19f28079fd7574..475aa3f5c617b7 100644 --- a/packages/mui-base/src/SliderUnstyled/useSlider.types.ts +++ b/packages/mui-base/src/SliderUnstyled/useSlider.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export interface UseSliderParameters { 'aria-labelledby'?: string; diff --git a/packages/mui-base/src/SnackbarUnstyled/SnackbarUnstyled.types.ts b/packages/mui-base/src/SnackbarUnstyled/SnackbarUnstyled.types.ts index b423c13212f9f5..658416e6bffd78 100644 --- a/packages/mui-base/src/SnackbarUnstyled/SnackbarUnstyled.types.ts +++ b/packages/mui-base/src/SnackbarUnstyled/SnackbarUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps } from '@mui/types'; import ClickAwayListener, { ClickAwayListenerProps } from '../ClickAwayListener'; import { UseSnackbarParameters } from './useSnackbar.types'; diff --git a/packages/mui-base/src/SwitchUnstyled/useSwitch.test.tsx b/packages/mui-base/src/SwitchUnstyled/useSwitch.test.tsx index 4465f7e7a01e94..5f3eaa38ffe7ec 100644 --- a/packages/mui-base/src/SwitchUnstyled/useSwitch.test.tsx +++ b/packages/mui-base/src/SwitchUnstyled/useSwitch.test.tsx @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import { spy } from 'sinon'; import { act, diff --git a/packages/mui-base/src/SwitchUnstyled/useSwitch.types.ts b/packages/mui-base/src/SwitchUnstyled/useSwitch.types.ts index 7bbf590334b96c..fc03ab787e5727 100644 --- a/packages/mui-base/src/SwitchUnstyled/useSwitch.types.ts +++ b/packages/mui-base/src/SwitchUnstyled/useSwitch.types.ts @@ -1,4 +1,4 @@ -import React, { HTMLInputTypeAttribute } from 'react'; +import * as React from 'react'; export interface UseSwitchParameters { /** @@ -44,7 +44,7 @@ interface UseSwitchInputSlotOwnProps { readOnly?: boolean; ref: React.Ref; required?: boolean; - type: HTMLInputTypeAttribute; + type: React.HTMLInputTypeAttribute; } export type UseSwitchInputSlotProps = Omit & diff --git a/packages/mui-base/src/TabUnstyled/TabUnstyled.types.ts b/packages/mui-base/src/TabUnstyled/TabUnstyled.types.ts index ad485fd7f157cd..6fab3cf32bea34 100644 --- a/packages/mui-base/src/TabUnstyled/TabUnstyled.types.ts +++ b/packages/mui-base/src/TabUnstyled/TabUnstyled.types.ts @@ -1,5 +1,5 @@ import { OverrideProps, Simplify } from '@mui/types'; -import React from 'react'; +import * as React from 'react'; import { ButtonUnstyledOwnProps } from '../ButtonUnstyled'; import { SlotComponentProps } from '../utils'; import { UseTabRootSlotProps } from './useTab.types'; diff --git a/packages/mui-base/src/TabUnstyled/useTab.types.ts b/packages/mui-base/src/TabUnstyled/useTab.types.ts index 7fa5bcb29455aa..01d063acf5952c 100644 --- a/packages/mui-base/src/TabUnstyled/useTab.types.ts +++ b/packages/mui-base/src/TabUnstyled/useTab.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { UseButtonRootSlotProps } from '../ButtonUnstyled'; export interface UseTabParameters { diff --git a/packages/mui-base/src/TabsListUnstyled/TabsListUnstyled.types.ts b/packages/mui-base/src/TabsListUnstyled/TabsListUnstyled.types.ts index beb53a28d7716b..12d636b4cb1f1b 100644 --- a/packages/mui-base/src/TabsListUnstyled/TabsListUnstyled.types.ts +++ b/packages/mui-base/src/TabsListUnstyled/TabsListUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { UseTabsListRootSlotProps } from './useTabsList.types'; import { SlotComponentProps } from '../utils'; diff --git a/packages/mui-base/src/TabsUnstyled/TabsUnstyled.types.ts b/packages/mui-base/src/TabsUnstyled/TabsUnstyled.types.ts index 449149789b12f6..ef65ad3f4ce994 100644 --- a/packages/mui-base/src/TabsUnstyled/TabsUnstyled.types.ts +++ b/packages/mui-base/src/TabsUnstyled/TabsUnstyled.types.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { SlotComponentProps } from '../utils'; diff --git a/packages/mui-base/src/utils/isHostComponent.ts b/packages/mui-base/src/utils/isHostComponent.ts index 94e4c950a06d49..f94464fe4e38a4 100644 --- a/packages/mui-base/src/utils/isHostComponent.ts +++ b/packages/mui-base/src/utils/isHostComponent.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; /** * Determines if a given element is a DOM element name (i.e. not a React component). diff --git a/packages/mui-base/src/utils/useSlotProps.test.tsx b/packages/mui-base/src/utils/useSlotProps.test.tsx index 3d0fce22f9614f..6ba5e15bc1117b 100644 --- a/packages/mui-base/src/utils/useSlotProps.test.tsx +++ b/packages/mui-base/src/utils/useSlotProps.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { expect } from 'chai'; import { spy } from 'sinon'; import { EventHandlers } from '@mui/base'; diff --git a/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js b/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js index 5ecae14a7e1cf1..7d95d6ebbdcd59 100644 --- a/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js +++ b/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/actual-todo-comments.js @@ -6,7 +6,7 @@ import clsx from "clsx"; /* Comments that should not be lost when the clsx import comments are preserved. */ -import React from "react"; +import * as React from "react"; import { makeStyles } from "@material-ui/core"; const useStyles = makeStyles(() => ({ diff --git a/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js b/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js index b33695fc55265c..e190d8f9e008cb 100644 --- a/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js +++ b/packages/mui-codemod/src/v5.0.0/jss-to-tss-react.test/expected-todo-comments.js @@ -5,7 +5,7 @@ any comments that they get combined with. /* Comments that should not be lost when the clsx import comments are preserved. */ -import React from "react"; +import * as React from "react"; import { makeStyles } from 'tss-react/mui'; // TODO jss-to-tss-react codemod: Unable to handle style definition reliably. ArrowFunctionExpression in CSS prop. diff --git a/packages/mui-joy/src/Button/ButtonProps.ts b/packages/mui-joy/src/Button/ButtonProps.ts index 622fa7ac8384bf..c3f34429820c10 100644 --- a/packages/mui-joy/src/Button/ButtonProps.ts +++ b/packages/mui-joy/src/Button/ButtonProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableComponent, OverridableStringUnion, diff --git a/packages/mui-joy/src/Grid/GridProps.ts b/packages/mui-joy/src/Grid/GridProps.ts index 863094b1ebaa83..0b244ee32ccf1c 100644 --- a/packages/mui-joy/src/Grid/GridProps.ts +++ b/packages/mui-joy/src/Grid/GridProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { GridBaseProps } from '@mui/system/Unstable_Grid'; import { SxProps, SystemProps } from '../styles/types'; diff --git a/packages/mui-joy/src/IconButton/IconButtonProps.ts b/packages/mui-joy/src/IconButton/IconButtonProps.ts index 09b624d4cfffd7..29cb334cc0340f 100644 --- a/packages/mui-joy/src/IconButton/IconButtonProps.ts +++ b/packages/mui-joy/src/IconButton/IconButtonProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableComponent, OverridableStringUnion, diff --git a/packages/mui-joy/src/Input/InputProps.ts b/packages/mui-joy/src/Input/InputProps.ts index c27a6044b3564d..b3b9f01dbce28c 100644 --- a/packages/mui-joy/src/Input/InputProps.ts +++ b/packages/mui-joy/src/Input/InputProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableStringUnion, OverrideProps } from '@mui/types'; import { SlotComponentProps } from '@mui/base/utils'; import { ColorPaletteProp, VariantProp, SxProps, ApplyColorInversion } from '../styles/types'; diff --git a/packages/mui-joy/src/Link/LinkProps.ts b/packages/mui-joy/src/Link/LinkProps.ts index 00d53e19113da3..6f28525a71638d 100644 --- a/packages/mui-joy/src/Link/LinkProps.ts +++ b/packages/mui-joy/src/Link/LinkProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableStringUnion, OverrideProps } from '@mui/types'; import { SlotComponentProps } from '@mui/base/utils'; import { diff --git a/packages/mui-joy/src/Select/SelectProps.ts b/packages/mui-joy/src/Select/SelectProps.ts index a6df20a52b39c8..37b66df1c4005d 100644 --- a/packages/mui-joy/src/Select/SelectProps.ts +++ b/packages/mui-joy/src/Select/SelectProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableStringUnion, OverrideProps } from '@mui/types'; import { SelectUnstyledCommonProps, SelectOption } from '@mui/base/SelectUnstyled'; import { PopperUnstyledOwnProps } from '@mui/base/PopperUnstyled'; diff --git a/packages/mui-joy/src/Textarea/TextareaProps.ts b/packages/mui-joy/src/Textarea/TextareaProps.ts index 358e0b479bd066..6cd44b15338d95 100644 --- a/packages/mui-joy/src/Textarea/TextareaProps.ts +++ b/packages/mui-joy/src/Textarea/TextareaProps.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverridableStringUnion, OverrideProps } from '@mui/types'; import { SlotComponentProps } from '@mui/base/utils'; import { ColorPaletteProp, VariantProp, SxProps, ApplyColorInversion } from '../styles/types'; diff --git a/packages/mui-material/src/Unstable_Grid2/Grid2Props.ts b/packages/mui-material/src/Unstable_Grid2/Grid2Props.ts index 668ce5f197a60b..7f2ab917c51a27 100644 --- a/packages/mui-material/src/Unstable_Grid2/Grid2Props.ts +++ b/packages/mui-material/src/Unstable_Grid2/Grid2Props.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { SxProps, SystemProps } from '@mui/system'; import { GridBaseProps } from '@mui/system/Unstable_Grid';