diff --git a/.dumi/hooks/useLocation.ts b/.dumi/hooks/useLocation.ts index d978cc4a08..3499a3bbe2 100644 --- a/.dumi/hooks/useLocation.ts +++ b/.dumi/hooks/useLocation.ts @@ -1,5 +1,5 @@ import { useLocation as useDumiLocation } from 'dumi'; -import React from 'react'; +import * as React from 'react'; import useLocale from './useLocale'; function clearPath(path: string) { diff --git a/.dumi/pages/index/components/Banner.tsx b/.dumi/pages/index/components/Banner.tsx index d7b0b87fce..781a09da45 100644 --- a/.dumi/pages/index/components/Banner.tsx +++ b/.dumi/pages/index/components/Banner.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; import { Button, Space, Typography } from 'antd'; import { Link, useLocation } from 'dumi'; -import React from 'react'; +import * as React from 'react'; import useLocale from '../../../hooks/useLocale'; import useSiteToken from '../../../hooks/useSiteToken'; import SiteContext from '../../../theme/slots/SiteContext'; diff --git a/.dumi/pages/index/components/BannerRecommends.tsx b/.dumi/pages/index/components/BannerRecommends.tsx index b33a1810a9..6b50968b83 100644 --- a/.dumi/pages/index/components/BannerRecommends.tsx +++ b/.dumi/pages/index/components/BannerRecommends.tsx @@ -1,10 +1,10 @@ +import * as React from 'react'; +import { Typography, Skeleton, Carousel } from 'antd'; import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; -import { Carousel, Skeleton, Typography } from 'antd'; -import React from 'react'; +import type { Extra, Icon } from './util'; import useSiteToken from '../../../hooks/useSiteToken'; import SiteContext from '../../../theme/slots/SiteContext'; -import type { Extra, Icon } from './util'; import { useCarouselStyle } from './util'; const useStyle = () => { diff --git a/.dumi/pages/index/components/Group.tsx b/.dumi/pages/index/components/Group.tsx index 4e188657a4..8fa8ce059c 100644 --- a/.dumi/pages/index/components/Group.tsx +++ b/.dumi/pages/index/components/Group.tsx @@ -1,5 +1,6 @@ +import * as React from 'react'; +import { useContext } from 'react'; import { Typography } from 'antd'; -import React, { useContext } from 'react'; import useSiteToken from '../../../hooks/useSiteToken'; import SiteContext from '../../../theme/slots/SiteContext'; diff --git a/.dumi/pages/index/components/RecommendsOld.tsx b/.dumi/pages/index/components/RecommendsOld.tsx index 22f2f775e1..0a04a5559a 100644 --- a/.dumi/pages/index/components/RecommendsOld.tsx +++ b/.dumi/pages/index/components/RecommendsOld.tsx @@ -1,8 +1,8 @@ +import * as React from 'react'; +import { Row, Col, Typography } from 'antd'; import { css } from '@emotion/react'; -import { Col, Row, Typography } from 'antd'; -import React from 'react'; -import useSiteToken from '../../../hooks/useSiteToken'; import type { Recommendation } from './util'; +import useSiteToken from '../../../hooks/useSiteToken'; const useStyle = () => { const { token } = useSiteToken(); @@ -77,7 +77,7 @@ export interface RecommendsProps { recommendations?: Recommendation[]; } -const Recommends: React.FC = ({ recommendations = [] }) => { +export default function Recommends({ recommendations = [] }: RecommendsProps) { const { token } = useSiteToken(); const style = useStyle(); @@ -101,6 +101,4 @@ const Recommends: React.FC = ({ recommendations = [] }) => { })} ); -}; - -export default Recommends; +} diff --git a/.dumi/pages/index/components/SiteContext.ts b/.dumi/pages/index/components/SiteContext.ts index d41e57d9c4..9767a89b50 100644 --- a/.dumi/pages/index/components/SiteContext.ts +++ b/.dumi/pages/index/components/SiteContext.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export interface SiteContextProps { isMobile: boolean; diff --git a/.dumi/pages/index/components/Theme/MobileCarousel.tsx b/.dumi/pages/index/components/Theme/MobileCarousel.tsx index 1155171535..12fdeae6d4 100644 --- a/.dumi/pages/index/components/Theme/MobileCarousel.tsx +++ b/.dumi/pages/index/components/Theme/MobileCarousel.tsx @@ -1,8 +1,9 @@ +import * as React from 'react'; +import { useState } from 'react'; import { css } from '@emotion/react'; -import { Carousel, Typography } from 'antd'; -import React, { useState } from 'react'; -import useSiteToken from '../../../../hooks/useSiteToken'; +import { Typography, Carousel } from 'antd'; import { useCarouselStyle } from '../util'; +import useSiteToken from '../../../../hooks/useSiteToken'; const useStyle = () => { const { carousel } = useCarouselStyle(); diff --git a/.dumi/pages/index/components/Theme/ThemePicker.tsx b/.dumi/pages/index/components/Theme/ThemePicker.tsx index 7699b59594..b9fa6e7443 100644 --- a/.dumi/pages/index/components/Theme/ThemePicker.tsx +++ b/.dumi/pages/index/components/Theme/ThemePicker.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; import { Space } from 'antd'; -import React from 'react'; +import * as React from 'react'; import useSiteToken from '../../../../hooks/useSiteToken'; import useLocale from '../../../../hooks/useLocale'; diff --git a/.dumi/pages/index/components/Theme/index.tsx b/.dumi/pages/index/components/Theme/index.tsx index 7ee4646ee7..119b7f11a3 100644 --- a/.dumi/pages/index/components/Theme/index.tsx +++ b/.dumi/pages/index/components/Theme/index.tsx @@ -1,11 +1,12 @@ +import * as React from 'react'; +import { css } from '@emotion/react'; +import { TinyColor } from '@ctrl/tinycolor'; import { BellOutlined, FolderOutlined, HomeOutlined, QuestionCircleOutlined, } from '@ant-design/icons'; -import { TinyColor } from '@ctrl/tinycolor'; -import { css } from '@emotion/react'; import type { MenuProps } from 'antd'; import { Breadcrumb, @@ -17,22 +18,21 @@ import { Menu, Radio, Space, - Typography, theme, + Typography, } from 'antd'; -import React from 'react'; import useLocale from '../../../../hooks/useLocale'; import useSiteToken from '../../../../hooks/useSiteToken'; -import SiteContext from '../../../../theme/slots/SiteContext'; +import type { THEME } from './ThemePicker'; +import ThemePicker from './ThemePicker'; +import ColorPicker from './ColorPicker'; +import RadiusPicker from './RadiusPicker'; import Group from '../Group'; -import { useCarouselStyle } from '../util'; import BackgroundImage from './BackgroundImage'; -import ColorPicker from './ColorPicker'; +import { DEFAULT_COLOR, getAvatarURL, getClosetColor, PINK_COLOR } from './colorUtil'; +import SiteContext from '../../../../theme/slots/SiteContext'; +import { useCarouselStyle } from '../util'; import MobileCarousel from './MobileCarousel'; -import RadiusPicker from './RadiusPicker'; -import type { THEME } from './ThemePicker'; -import ThemePicker from './ThemePicker'; -import { DEFAULT_COLOR, PINK_COLOR, getAvatarURL, getClosetColor } from './colorUtil'; const { Header, Content, Sider } = Layout; diff --git a/.dumi/pages/index/components/util.ts b/.dumi/pages/index/components/util.ts index 727322640e..67921644f1 100644 --- a/.dumi/pages/index/components/util.ts +++ b/.dumi/pages/index/components/util.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { css } from '@emotion/react'; export interface Author { diff --git a/.dumi/theme/builtins/ColorChunk/index.tsx b/.dumi/theme/builtins/ColorChunk/index.tsx index 720c4f5e78..5ec1bdd2e3 100644 --- a/.dumi/theme/builtins/ColorChunk/index.tsx +++ b/.dumi/theme/builtins/ColorChunk/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { TinyColor, type ColorInput } from '@ctrl/tinycolor'; import { css } from '@emotion/react'; import useSiteToken from '../../../hooks/useSiteToken'; diff --git a/.dumi/theme/builtins/IconSearch/Category.tsx b/.dumi/theme/builtins/IconSearch/Category.tsx index d675a1dac1..f697fa01a6 100644 --- a/.dumi/theme/builtins/IconSearch/Category.tsx +++ b/.dumi/theme/builtins/IconSearch/Category.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { message } from 'antd'; import { useIntl } from 'dumi'; import CopyableIcon from './CopyableIcon'; diff --git a/.dumi/theme/builtins/IconSearch/CopyableIcon.tsx b/.dumi/theme/builtins/IconSearch/CopyableIcon.tsx index 76dcdf67cb..4563192391 100644 --- a/.dumi/theme/builtins/IconSearch/CopyableIcon.tsx +++ b/.dumi/theme/builtins/IconSearch/CopyableIcon.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Badge, message } from 'antd'; import classNames from 'classnames'; diff --git a/.dumi/theme/builtins/IconSearch/themeIcons.tsx b/.dumi/theme/builtins/IconSearch/themeIcons.tsx index 879a26742d..892a95dd29 100644 --- a/.dumi/theme/builtins/IconSearch/themeIcons.tsx +++ b/.dumi/theme/builtins/IconSearch/themeIcons.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { CustomIconComponentProps } from '@ant-design/icons/es/components/Icon'; type CustomIconComponent = React.ComponentType< diff --git a/.dumi/theme/builtins/ResourceArticles/index.tsx b/.dumi/theme/builtins/ResourceArticles/index.tsx index 7e74bc08f4..4fafbcf46a 100644 --- a/.dumi/theme/builtins/ResourceArticles/index.tsx +++ b/.dumi/theme/builtins/ResourceArticles/index.tsx @@ -1,5 +1,5 @@ /* eslint-disable react/no-array-index-key */ -import React from 'react'; +import * as React from 'react'; import dayjs from 'dayjs'; import { FormattedMessage, useIntl } from 'dumi'; import { Tabs, Skeleton, Avatar, Divider, Empty } from 'antd'; diff --git a/.dumi/theme/builtins/TokenTable/index.tsx b/.dumi/theme/builtins/TokenTable/index.tsx index d3c0b90c96..3c2b17d685 100644 --- a/.dumi/theme/builtins/TokenTable/index.tsx +++ b/.dumi/theme/builtins/TokenTable/index.tsx @@ -1,5 +1,5 @@ import type { FC } from 'react'; -import React from 'react'; +import * as React from 'react'; /* eslint import/no-unresolved: 0 */ import { css } from '@emotion/react'; import type { TableProps } from 'antd'; diff --git a/.dumi/theme/common/Helmet.tsx b/.dumi/theme/common/Helmet.tsx index a675569113..4bc99ec82c 100644 --- a/.dumi/theme/common/Helmet.tsx +++ b/.dumi/theme/common/Helmet.tsx @@ -1,5 +1,5 @@ +import * as React from 'react'; import { Helmet } from 'dumi'; -import React from 'react'; type HelmetProps = Helmet['props']; export interface WrapHelmetProps extends HelmetProps { diff --git a/.dumi/theme/layouts/ResourceLayout/AffixTabs.tsx b/.dumi/theme/layouts/ResourceLayout/AffixTabs.tsx index d19972204e..5fc69f312b 100644 --- a/.dumi/theme/layouts/ResourceLayout/AffixTabs.tsx +++ b/.dumi/theme/layouts/ResourceLayout/AffixTabs.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/react'; import { Tabs } from 'antd'; import throttle from 'lodash/throttle'; -import React from 'react'; +import * as React from 'react'; import scrollTo from '../../../../components/_util/scrollTo'; import useSiteToken from '../../../hooks/useSiteToken'; diff --git a/.dumi/theme/slots/Footer/AdditionalInfo.tsx b/.dumi/theme/slots/Footer/AdditionalInfo.tsx index 48c9b4a171..447b4be308 100644 --- a/.dumi/theme/slots/Footer/AdditionalInfo.tsx +++ b/.dumi/theme/slots/Footer/AdditionalInfo.tsx @@ -1,5 +1,5 @@ import { removeCSS, updateCSS } from 'rc-util/lib/Dom/dynamicCSS'; -import React from 'react'; +import * as React from 'react'; import useLocale from '../../../hooks/useLocale'; const whereCls = 'ant-where-checker'; diff --git a/.dumi/theme/slots/Header/Logo.tsx b/.dumi/theme/slots/Header/Logo.tsx index ae43b2a211..ac5cfa2dcf 100644 --- a/.dumi/theme/slots/Header/Logo.tsx +++ b/.dumi/theme/slots/Header/Logo.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react'; import { Link, useLocation } from 'dumi'; -import React from 'react'; +import * as React from 'react'; import useSiteToken from '../../../hooks/useSiteToken'; import * as utils from '../../utils'; diff --git a/.dumi/theme/slots/Header/Navigation.tsx b/.dumi/theme/slots/Header/Navigation.tsx index 3bb4b30441..7bdc0e8859 100644 --- a/.dumi/theme/slots/Header/Navigation.tsx +++ b/.dumi/theme/slots/Header/Navigation.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { FormattedMessage, Link, useFullSidebarData, useLocation } from 'dumi'; import type { MenuProps } from 'antd'; import { Menu } from 'antd'; diff --git a/.dumi/theme/slots/SiteContext.ts b/.dumi/theme/slots/SiteContext.ts index 3636640164..179aa6dc33 100644 --- a/.dumi/theme/slots/SiteContext.ts +++ b/.dumi/theme/slots/SiteContext.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { DirectionType } from 'antd/es/config-provider'; import type { ThemeName } from '../common/ThemeSwitch'; diff --git a/.dumirc.ts b/.dumirc.ts index e8cc71af14..97a51f5e32 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -35,7 +35,7 @@ export default defineConfig({ }, extraRehypePlugins: [rehypeAntd], extraRemarkPlugins: [remarkAntd], - extraBabelPresets: ['@emotion/babel-preset-css-prop'], + extraBabelPresets: [require.resolve('@emotion/babel-preset-css-prop')], mfsu: false, metas: [{ name: 'theme-color', content: '#1677ff' }], analytics: { diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 2596cb5479..3efa2cc005 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,18 @@ timeline: true --- +## 5.4.7 + +`2023-05-06` + +- 🐞 Fix Menu different margin between Menu.Item and Menu.Submenu in vertical and inline mode. [#42160](https://github.com/ant-design/ant-design/pull/42160) +- 🐞 Fix Breadcrumb using `itemRender` with `path` render additional a element. [#42049](https://github.com/ant-design/ant-design/pull/42049) +- 🐞 Fix Transfer in control mode throw React nest state update warning. [#42033](https://github.com/ant-design/ant-design/pull/42033) +- 🐞 Fix Upload logic of disable state. [#42102](https://github.com/ant-design/ant-design/pull/42102) [@Wxh16144](https://github.com/Wxh16144) +- 💄 Fix Spin height is inconsistent with its icon children. [#42162](https://github.com/ant-design/ant-design/pull/42162) [@cheapCoder](https://github.com/cheapCoder) +- ⚡️ Improve Affix logic when it does not need to update. [#42015](https://github.com/ant-design/ant-design/pull/42015) [@Simon-He95](https://github.com/Simon-He95) +- ⚡️ Improve Anchor logic when it does not need to scroll. [#42018](https://github.com/ant-design/ant-design/pull/42018) [@Simon-He95](https://github.com/Simon-He95) + ## 5.4.6 `2023-04-26` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 5e0d6b5b9b..452b65ef5f 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,18 @@ timeline: true --- +## 5.4.7 + +`2023-05-06` + +- 🐞 修复 Menu.Item 与 Submenu 之间间距不统一的问题。[#42160](https://github.com/ant-design/ant-design/pull/42160) +- 🐞 修复 Breadcrumb 使用 `itemRender` 并且配置 `path` 时,渲染元素会额外包一层 a 元素的问题。[#42049](https://github.com/ant-design/ant-design/pull/42049) +- 🐞 修复 Transfer 在受控模式下报 React 状态嵌套更新错误信息。[#42033](https://github.com/ant-design/ant-design/pull/42033) +- 🐞 修复 Upload 禁用状态的逻辑。[#42102](https://github.com/ant-design/ant-design/pull/42102) [@Wxh16144](https://github.com/Wxh16144) +- 💄 修复 Spin 与其 icon 子元素高度不一致的问题。[#42162](https://github.com/ant-design/ant-design/pull/42162) [@cheapCoder](https://github.com/cheapCoder) +- ⚡️ 优化 Affix 组件在无需更新时计算逻辑。[#42015](https://github.com/ant-design/ant-design/pull/42015) [@Simon-He95](https://github.com/Simon-He95) +- ⚡️ 优化 Anchor 组件在无需跳转时计算逻辑。[#42018](https://github.com/ant-design/ant-design/pull/42018) [@Simon-He95](https://github.com/Simon-He95) + ## 5.4.6 `2023-04-26` diff --git a/components/__tests__/node.test.tsx b/components/__tests__/node.test.tsx index 22ffb0a0fc..cc63dd37e4 100644 --- a/components/__tests__/node.test.tsx +++ b/components/__tests__/node.test.tsx @@ -1,5 +1,5 @@ import { globSync } from 'glob'; -import React from 'react'; +import * as React from 'react'; import { renderToString } from 'react-dom/server'; import type { Options } from '../../tests/shared/demoTest'; diff --git a/components/__tests__/setup.test.tsx b/components/__tests__/setup.test.tsx index f5ede05a2b..f555f13ee6 100644 --- a/components/__tests__/setup.test.tsx +++ b/components/__tests__/setup.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '../../tests/utils'; describe('SetUp.Test', () => { diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index 3ed54f794e..410e9aad24 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -1,5 +1,5 @@ import useState from 'rc-util/lib/hooks/useState'; -import React from 'react'; +import * as React from 'react'; import Button from '../button'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import { convertLegacyProps } from '../button/button'; diff --git a/components/_util/PurePanel.tsx b/components/_util/PurePanel.tsx index 3a04a9355a..49e8b2c16e 100644 --- a/components/_util/PurePanel.tsx +++ b/components/_util/PurePanel.tsx @@ -1,5 +1,5 @@ import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import React from 'react'; +import * as React from 'react'; import ConfigProvider, { ConfigContext } from '../config-provider'; export interface BaseProps { diff --git a/components/_util/hooks/useFlexGapSupport.ts b/components/_util/hooks/useFlexGapSupport.ts index be249b4c6c..b0640f0f07 100644 --- a/components/_util/hooks/useFlexGapSupport.ts +++ b/components/_util/hooks/useFlexGapSupport.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { detectFlexGapSupported } from '../styleChecker'; export default () => { diff --git a/components/_util/hooks/useForceUpdate.ts b/components/_util/hooks/useForceUpdate.ts index 21fa97810b..d053a1986a 100644 --- a/components/_util/hooks/useForceUpdate.ts +++ b/components/_util/hooks/useForceUpdate.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export default function useForceUpdate() { const [, forceUpdate] = React.useReducer((x) => x + 1, 0); diff --git a/components/_util/hooks/usePatchElement.tsx b/components/_util/hooks/usePatchElement.tsx index 239f2b2ba1..d2e9f92a89 100644 --- a/components/_util/hooks/usePatchElement.tsx +++ b/components/_util/hooks/usePatchElement.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export default function usePatchElement(): [ React.ReactElement[], diff --git a/components/_util/hooks/useSyncState.ts b/components/_util/hooks/useSyncState.ts index a9f7714c04..03fcb47097 100644 --- a/components/_util/hooks/useSyncState.ts +++ b/components/_util/hooks/useSyncState.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import useForceUpdate from './useForceUpdate'; type UseSyncStateProps = readonly [() => T, (newValue: T) => void]; diff --git a/components/_util/reactNode.ts b/components/_util/reactNode.ts index 4af272d099..8e5b73c016 100644 --- a/components/_util/reactNode.ts +++ b/components/_util/reactNode.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export const { isValidElement } = React; diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index 77f4e88e82..73a9f9906a 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -4,7 +4,7 @@ * This helps accessibility reader to tread as a interactive button to operation. */ import KeyCode from 'rc-util/lib/KeyCode'; -import React from 'react'; +import * as React from 'react'; interface TransButtonProps extends React.HTMLAttributes { onClick?: (e?: React.MouseEvent) => void; diff --git a/components/_util/wave/WaveEffect.tsx b/components/_util/wave/WaveEffect.tsx index 7f5f370559..2a87aacb5f 100644 --- a/components/_util/wave/WaveEffect.tsx +++ b/components/_util/wave/WaveEffect.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import { render, unmount } from 'rc-util/lib/React/render'; import raf from 'rc-util/lib/raf'; -import React from 'react'; +import * as React from 'react'; import { getTargetWaveColor } from './util'; function validateNum(value: number) { diff --git a/components/affix/__tests__/demo.test.tsx b/components/affix/__tests__/demo.test.tsx index ab5c28df84..85dc90a0e6 100644 --- a/components/affix/__tests__/demo.test.tsx +++ b/components/affix/__tests__/demo.test.tsx @@ -1,5 +1,5 @@ import { spyElementPrototype } from 'rc-util/lib/test/domHook'; -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('affix', { diff --git a/components/alert/ErrorBoundary.tsx b/components/alert/ErrorBoundary.tsx index bb0ced36f6..86861d011e 100644 --- a/components/alert/ErrorBoundary.tsx +++ b/components/alert/ErrorBoundary.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Alert from '.'; interface ErrorBoundaryProps { diff --git a/components/alert/index.tsx b/components/alert/index.tsx index f74ad548db..e5cbedd01b 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -6,7 +6,7 @@ import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled'; import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import type { ReactElement } from 'react'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import getDataOrAriaProps from '../_util/getDataOrAriaProps'; import { replaceElement } from '../_util/reactNode'; diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index e3bc91baff..7888a4e5f7 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import useEvent from 'rc-util/lib/hooks/useEvent'; -import React from 'react'; +import * as React from 'react'; import scrollIntoView from 'scroll-into-view-if-needed'; import Affix from '../affix'; diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index 08606fed7d..3743e85971 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; import type { AntAnchor } from './Anchor'; diff --git a/components/anchor/__tests__/demo.test.tsx b/components/anchor/__tests__/demo.test.tsx index 37f5fcdf7a..3d68d0fd2c 100644 --- a/components/anchor/__tests__/demo.test.tsx +++ b/components/anchor/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('anchor', { diff --git a/components/anchor/context.ts b/components/anchor/context.ts index 7324398eec..ab5c0474e2 100644 --- a/components/anchor/context.ts +++ b/components/anchor/context.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { AntAnchor } from './Anchor'; const AnchorContext = React.createContext(undefined); diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index f95f5606fd..613d41b416 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -10,7 +10,7 @@ import classNames from 'classnames'; import type { BaseSelectRef } from 'rc-select'; import toArray from 'rc-util/lib/Children/toArray'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; import { isValidElement } from '../_util/reactNode'; import type { InputStatus } from '../_util/statusUtils'; diff --git a/components/avatar/SizeContext.tsx b/components/avatar/SizeContext.tsx index beffc3a69d..b66c624b11 100644 --- a/components/avatar/SizeContext.tsx +++ b/components/avatar/SizeContext.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { ScreenSizeMap } from '../_util/responsiveObserver'; export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap; diff --git a/components/avatar/__tests__/demo.test.tsx b/components/avatar/__tests__/demo.test.tsx index 031a91d8b1..71d78cbd05 100644 --- a/components/avatar/__tests__/demo.test.tsx +++ b/components/avatar/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('avatar'); diff --git a/components/avatar/avatar.tsx b/components/avatar/avatar.tsx index ce67344aeb..bcecaf9acb 100644 --- a/components/avatar/avatar.tsx +++ b/components/avatar/avatar.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import ResizeObserver from 'rc-resize-observer'; import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useBreakpoint from '../grid/hooks/useBreakpoint'; import type { Breakpoint } from '../_util/responsiveObserver'; diff --git a/components/avatar/group.tsx b/components/avatar/group.tsx index 9305d62e06..4e0f29c8d0 100644 --- a/components/avatar/group.tsx +++ b/components/avatar/group.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import Popover from '../popover'; import { cloneElement } from '../_util/reactNode'; diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index ad0d999fc3..eeee024195 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -2,14 +2,14 @@ import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; +import type { ConfigConsumerProps } from '../config-provider'; +import { ConfigContext } from '../config-provider'; import getScroll from '../_util/getScroll'; import { cloneElement } from '../_util/reactNode'; import scrollTo from '../_util/scrollTo'; import throttleByAnimationFrame from '../_util/throttleByAnimationFrame'; import warning from '../_util/warning'; -import type { ConfigConsumerProps } from '../config-provider'; -import { ConfigContext } from '../config-provider'; import useStyle from './style'; export interface BackTopProps { diff --git a/components/badge/Ribbon.tsx b/components/badge/Ribbon.tsx index 2ffaea5cbb..05760f6e93 100644 --- a/components/badge/Ribbon.tsx +++ b/components/badge/Ribbon.tsx @@ -1,10 +1,10 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; +import { ConfigContext } from '../config-provider'; import type { PresetColorType } from '../_util/colors'; -import { isPresetColor } from '../_util/colors'; import type { LiteralUnion } from '../_util/type'; -import { ConfigContext } from '../config-provider'; import useStyle from './style'; +import { isPresetColor } from '../_util/colors'; type RibbonPlacement = 'start' | 'end'; diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index 8ccbedc803..83eaafbde5 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; -import React from 'react'; -import { cloneElement } from '../_util/reactNode'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; +import { cloneElement } from '../_util/reactNode'; import SingleNumber from './SingleNumber'; export interface ScrollNumberProps { diff --git a/components/badge/SingleNumber.tsx b/components/badge/SingleNumber.tsx index 01e04505c7..992ecf3775 100644 --- a/components/badge/SingleNumber.tsx +++ b/components/badge/SingleNumber.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; export interface UnitNumberProps { prefixCls: string; diff --git a/components/badge/index.tsx b/components/badge/index.tsx index c9b7e43400..4967cd0a37 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -1,12 +1,13 @@ import classNames from 'classnames'; import CSSMotion from 'rc-motion'; -import React, { useMemo, useRef } from 'react'; +import * as React from 'react'; +import { useMemo, useRef } from 'react'; +import { ConfigContext } from '../config-provider'; +import type { PresetColorKey } from '../theme/internal'; import type { PresetStatusColorType } from '../_util/colors'; import { isPresetColor } from '../_util/colors'; import { cloneElement } from '../_util/reactNode'; import type { LiteralUnion } from '../_util/type'; -import { ConfigContext } from '../config-provider'; -import type { PresetColorKey } from '../theme/internal'; import Ribbon from './Ribbon'; import ScrollNumber from './ScrollNumber'; import useStyle from './style'; diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index f6db921045..bffc0eddbd 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; import pickAttrs from 'rc-util/lib/pickAttrs'; -import React from 'react'; +import * as React from 'react'; import { cloneElement } from '../_util/reactNode'; import warning from '../_util/warning'; import { ConfigContext } from '../config-provider'; diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index 5f64701514..0cb432e1b8 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -1,5 +1,5 @@ import DownOutlined from '@ant-design/icons/DownOutlined'; -import React from 'react'; +import * as React from 'react'; import warning from '../_util/warning'; import { ConfigContext } from '../config-provider'; import type { DropdownProps } from '../dropdown/dropdown'; diff --git a/components/breadcrumb/BreadcrumbSeparator.tsx b/components/breadcrumb/BreadcrumbSeparator.tsx index 914a8f6ba7..380eb5cbba 100644 --- a/components/breadcrumb/BreadcrumbSeparator.tsx +++ b/components/breadcrumb/BreadcrumbSeparator.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; type CompoundedComponent = React.FC<{ children?: React.ReactNode }> & { diff --git a/components/breadcrumb/useItemRender.tsx b/components/breadcrumb/useItemRender.tsx index d16136d18d..11d10f3b29 100644 --- a/components/breadcrumb/useItemRender.tsx +++ b/components/breadcrumb/useItemRender.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import pickAttrs from 'rc-util/lib/pickAttrs'; -import React from 'react'; +import * as React from 'react'; import type { BreadcrumbProps, InternalRouteType, ItemType } from './Breadcrumb'; type AddParameters any, TParameters extends [...args: any]> = ( diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 337c76d075..d38df65ab8 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SizeType } from '../config-provider/SizeContext'; import { useToken } from '../theme/internal'; diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 3a7d045c05..15efba8029 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -1,6 +1,7 @@ import type { GenerateConfig } from 'rc-picker/lib/generate'; import type { Locale } from 'rc-picker/lib/interface'; -import React, { useContext, useMemo } from 'react'; +import * as React from 'react'; +import { useContext, useMemo } from 'react'; import { FormItemInputContext } from '../form/context'; import { Button, Group } from '../radio'; import Select from '../select'; diff --git a/components/calendar/generateCalendar.tsx b/components/calendar/generateCalendar.tsx index 3d9cb27d9c..278a91253f 100644 --- a/components/calendar/generateCalendar.tsx +++ b/components/calendar/generateCalendar.tsx @@ -8,7 +8,7 @@ import type { PickerPanelTimeProps as RCPickerPanelTimeProps, } from 'rc-picker/lib/PickerPanel'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { useLocale } from '../locale'; import CalendarHeader from './Header'; diff --git a/components/card/Card.tsx b/components/card/Card.tsx index 1702eb9d2c..dfd3c9f034 100644 --- a/components/card/Card.tsx +++ b/components/card/Card.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import SizeContext from '../config-provider/SizeContext'; import Skeleton from '../skeleton'; diff --git a/components/card/Grid.tsx b/components/card/Grid.tsx index 4bcd9ec1df..5b4f87ee8e 100644 --- a/components/card/Grid.tsx +++ b/components/card/Grid.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { ConfigConsumerProps } from '../config-provider'; diff --git a/components/card/Meta.tsx b/components/card/Meta.tsx index e9b8327427..55107619ca 100644 --- a/components/card/Meta.tsx +++ b/components/card/Meta.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; diff --git a/components/card/__tests__/type.test.tsx b/components/card/__tests__/type.test.tsx index 66cc2cc3b4..19eae9739f 100644 --- a/components/card/__tests__/type.test.tsx +++ b/components/card/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Card from '../index'; describe('Card.typescript', () => { diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index a3725ea26c..dd7360d702 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -1,7 +1,7 @@ import type { Settings } from '@ant-design/react-slick'; import SlickCarousel from '@ant-design/react-slick'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useStyle from './style'; diff --git a/components/cascader/__tests__/demo.test.tsx b/components/cascader/__tests__/demo.test.tsx index 4295349709..53c929e436 100644 --- a/components/cascader/__tests__/demo.test.tsx +++ b/components/cascader/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('cascader', { diff --git a/components/cascader/__tests__/type.test.tsx b/components/cascader/__tests__/type.test.tsx index 3e50cd7e16..e0c9010e65 100644 --- a/components/cascader/__tests__/type.test.tsx +++ b/components/cascader/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { BaseOptionType } from '..'; import Cascader from '..'; import { render } from '../../../tests/utils'; diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index bc466cb6d0..f11cdb002e 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -13,7 +13,7 @@ import type { import RcCascader from 'rc-cascader'; import type { Placement } from 'rc-select/lib/BaseSelect'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import DisabledContext from '../config-provider/DisabledContext'; import type { SizeType } from '../config-provider/SizeContext'; diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index 3544ddfea8..459f38b75d 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import type { CheckboxRef } from 'rc-checkbox'; import RcCheckbox from 'rc-checkbox'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { FormItemInputContext } from '../form/context'; import warning from '../_util/warning'; diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index 9db92501d6..ce583f6bd3 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { CheckboxChangeEvent } from './Checkbox'; import Checkbox from './Checkbox'; diff --git a/components/checkbox/__tests__/demo.test.tsx b/components/checkbox/__tests__/demo.test.tsx index 7cdebc3229..c506cb1542 100644 --- a/components/checkbox/__tests__/demo.test.tsx +++ b/components/checkbox/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('checkbox'); diff --git a/components/checkbox/__tests__/type.test.tsx b/components/checkbox/__tests__/type.test.tsx index 6492e5c6da..3852519274 100644 --- a/components/checkbox/__tests__/type.test.tsx +++ b/components/checkbox/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Checkbox from '..'; import Input from '../../input'; diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index 80b62ea032..0742b2908f 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -2,7 +2,7 @@ import RightOutlined from '@ant-design/icons/RightOutlined'; import classNames from 'classnames'; import RcCollapse from 'rc-collapse'; import type { CSSMotionProps } from 'rc-motion'; -import React from 'react'; +import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import omit from 'rc-util/lib/omit'; diff --git a/components/collapse/CollapsePanel.tsx b/components/collapse/CollapsePanel.tsx index 9fc43d5f66..c05d902e54 100644 --- a/components/collapse/CollapsePanel.tsx +++ b/components/collapse/CollapsePanel.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import RcCollapse from 'rc-collapse'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; diff --git a/components/config-provider/DisabledContext.tsx b/components/config-provider/DisabledContext.tsx index c24399e3c6..d67773838b 100644 --- a/components/config-provider/DisabledContext.tsx +++ b/components/config-provider/DisabledContext.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export type DisabledType = boolean | undefined; diff --git a/components/config-provider/SizeContext.tsx b/components/config-provider/SizeContext.tsx index b1c523530e..5bc5924017 100644 --- a/components/config-provider/SizeContext.tsx +++ b/components/config-provider/SizeContext.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export type SizeType = 'small' | 'middle' | 'large' | undefined; diff --git a/components/config-provider/__tests__/cssinjs.test.tsx b/components/config-provider/__tests__/cssinjs.test.tsx index 33a5236cdb..38c272f51f 100644 --- a/components/config-provider/__tests__/cssinjs.test.tsx +++ b/components/config-provider/__tests__/cssinjs.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { SmileOutlined } from '@ant-design/icons'; import ConfigProvider from '..'; import Button from '../../button'; diff --git a/components/config-provider/context.ts b/components/config-provider/context.ts index c4481fd7f0..ea805d2481 100644 --- a/components/config-provider/context.ts +++ b/components/config-provider/context.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { DerivativeFunc } from '@ant-design/cssinjs'; import type { Options } from 'scroll-into-view-if-needed'; import type { RequiredMark } from '../form/Form'; diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 93b5849955..32cdd11f59 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -5,7 +5,7 @@ import type { ValidateMessages } from 'rc-field-form/lib/interface'; import { setValues } from 'rc-field-form/lib/utils/valueUtil'; import useMemo from 'rc-util/lib/hooks/useMemo'; import type { ReactElement } from 'react'; -import React from 'react'; +import * as React from 'react'; import type { Options } from 'scroll-into-view-if-needed'; import warning from '../_util/warning'; import type { RequiredMark } from '../form/Form'; diff --git a/components/date-picker/PickerButton.tsx b/components/date-picker/PickerButton.tsx index 471d7d5c06..bf8b0f462b 100644 --- a/components/date-picker/PickerButton.tsx +++ b/components/date-picker/PickerButton.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { ButtonProps } from '../button'; import Button from '../button'; diff --git a/components/date-picker/__tests__/demo.test.tsx b/components/date-picker/__tests__/demo.test.tsx index bfe3f11a22..e249126e32 100644 --- a/components/date-picker/__tests__/demo.test.tsx +++ b/components/date-picker/__tests__/demo.test.tsx @@ -1,5 +1,5 @@ import dayjs from 'dayjs'; -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('date-picker', { skip: ['locale.tsx'], testRootProps: false }); diff --git a/components/date-picker/__tests__/type.test.tsx b/components/date-picker/__tests__/type.test.tsx index 96fec7c2b2..06f0851937 100644 --- a/components/date-picker/__tests__/type.test.tsx +++ b/components/date-picker/__tests__/type.test.tsx @@ -1,5 +1,5 @@ import type { Dayjs } from 'dayjs'; -import React from 'react'; +import * as React from 'react'; import DatePicker from '..'; import type { DatePickRef, RangePickerRef } from '../generatePicker/interface'; diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx index 380c744d61..a6bd7e6fc5 100644 --- a/components/date-picker/generatePicker/generateRangePicker.tsx +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -5,17 +5,18 @@ import SwapRightOutlined from '@ant-design/icons/SwapRightOutlined'; import classNames from 'classnames'; import { RangePicker as RCRangePicker } from 'rc-picker'; import type { GenerateConfig } from 'rc-picker/lib/generate/index'; -import React, { forwardRef, useContext, useImperativeHandle } from 'react'; +import * as React from 'react'; +import { forwardRef, useContext, useImperativeHandle } from 'react'; import type { RangePickerProps } from '.'; import { Components, getTimeProps } from '.'; -import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; -import warning from '../../_util/warning'; import { ConfigContext } from '../../config-provider'; import DisabledContext from '../../config-provider/DisabledContext'; import SizeContext from '../../config-provider/SizeContext'; import { FormItemInputContext } from '../../form/context'; import { useLocale } from '../../locale'; import { useCompactItemContext } from '../../space/Compact'; +import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; +import warning from '../../_util/warning'; import enUS from '../locale/en_US'; import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util'; import type { CommonPickerMethods, PickerComponentClass } from './interface'; diff --git a/components/date-picker/generatePicker/generateSinglePicker.tsx b/components/date-picker/generatePicker/generateSinglePicker.tsx index 4d6386e4e9..ae755cfa3c 100644 --- a/components/date-picker/generatePicker/generateSinglePicker.tsx +++ b/components/date-picker/generatePicker/generateSinglePicker.tsx @@ -5,18 +5,19 @@ import classNames from 'classnames'; import RCPicker from 'rc-picker'; import type { GenerateConfig } from 'rc-picker/lib/generate/index'; import type { PickerMode } from 'rc-picker/lib/interface'; -import React, { forwardRef, useContext, useImperativeHandle } from 'react'; +import * as React from 'react'; +import { forwardRef, useContext, useImperativeHandle } from 'react'; import type { PickerProps, PickerTimeProps } from '.'; import { Components, getTimeProps } from '.'; -import type { InputStatus } from '../../_util/statusUtils'; -import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; -import warning from '../../_util/warning'; import { ConfigContext } from '../../config-provider'; import DisabledContext from '../../config-provider/DisabledContext'; import SizeContext from '../../config-provider/SizeContext'; import { FormItemInputContext } from '../../form/context'; import { useLocale } from '../../locale'; import { useCompactItemContext } from '../../space/Compact'; +import type { InputStatus } from '../../_util/statusUtils'; +import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; +import warning from '../../_util/warning'; import enUS from '../locale/en_US'; import { getPlaceholder, transPlacement2DropdownAlign } from '../util'; import type { CommonPickerMethods, DatePickRef, PickerComponentClass } from './interface'; diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index e9f55641d8..fe7bd3ca2a 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; function notEmpty(val: any) { return val !== undefined && val !== null; diff --git a/components/descriptions/Row.tsx b/components/descriptions/Row.tsx index 73a9c35b05..28ac218ece 100644 --- a/components/descriptions/Row.tsx +++ b/components/descriptions/Row.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { DescriptionsContextProps } from '.'; import { DescriptionsContext } from '.'; import Cell from './Cell'; diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 7f164f7221..bdd90448ff 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-array-index-key */ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { cloneElement } from '../_util/reactNode'; import type { Breakpoint, ScreenMap } from '../_util/responsiveObserver'; diff --git a/components/divider/__tests__/index.test.tsx b/components/divider/__tests__/index.test.tsx index e3e3e133d1..0e581f43b2 100644 --- a/components/divider/__tests__/index.test.tsx +++ b/components/divider/__tests__/index.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render } from '../../../tests/utils'; import Divider from '..'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/divider/index.tsx b/components/divider/index.tsx index 87c0e99015..cab33801a0 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; diff --git a/components/drawer/DrawerPanel.tsx b/components/drawer/DrawerPanel.tsx index f07f72ff16..6448cd7d78 100644 --- a/components/drawer/DrawerPanel.tsx +++ b/components/drawer/DrawerPanel.tsx @@ -1,7 +1,7 @@ import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import type { DrawerProps as RCDrawerProps } from 'rc-drawer'; -import React from 'react'; +import * as React from 'react'; export interface DrawerPanelProps { prefixCls: string; diff --git a/components/drawer/__tests__/demo-extend.test.tsx b/components/drawer/__tests__/demo-extend.test.tsx index 6e3eb5d683..5dd0a52c33 100644 --- a/components/drawer/__tests__/demo-extend.test.tsx +++ b/components/drawer/__tests__/demo-extend.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { extendTest } from '../../../tests/shared/demoTest'; jest.mock('rc-drawer', () => { diff --git a/components/drawer/__tests__/type.test.tsx b/components/drawer/__tests__/type.test.tsx index 6ed6cf79d8..b47fee0968 100644 --- a/components/drawer/__tests__/type.test.tsx +++ b/components/drawer/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Drawer from '..'; describe('Drawer.typescript', () => { diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 84c6ca49dd..8c19d95cfa 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import RcDrawer from 'rc-drawer'; import type { DrawerProps as RcDrawerProps } from 'rc-drawer'; import type { CSSMotionProps } from 'rc-motion'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { NoFormStyle } from '../form/context'; import { getTransitionName } from '../_util/motion'; diff --git a/components/dropdown/__tests__/demo.test.tsx b/components/dropdown/__tests__/demo.test.tsx index 0673e06c4f..e9679ee00c 100644 --- a/components/dropdown/__tests__/demo.test.tsx +++ b/components/dropdown/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('dropdown', { diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index 3b1f81dafe..bf10b08b7d 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; import Button from '../button'; import { ConfigContext } from '../config-provider'; diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index c5d14014cd..7a1a08f157 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -4,7 +4,7 @@ import RcDropdown from 'rc-dropdown'; import useEvent from 'rc-util/lib/hooks/useEvent'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; import type { AdjustOverflow } from '../_util/placements'; import getPlacements from '../_util/placements'; diff --git a/components/empty/empty.tsx b/components/empty/empty.tsx index f3000fe128..c382a34ab3 100644 --- a/components/empty/empty.tsx +++ b/components/empty/empty.tsx @@ -1,5 +1,5 @@ import { TinyColor } from '@ctrl/tinycolor'; -import React from 'react'; +import * as React from 'react'; import { useToken } from '../theme/internal'; const Empty: React.FC = () => { diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 39c9643e97..56e7628e76 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { useLocale } from '../locale'; import DefaultEmptyImg from './empty'; diff --git a/components/empty/simple.tsx b/components/empty/simple.tsx index 96403381df..f0b0dda188 100644 --- a/components/empty/simple.tsx +++ b/components/empty/simple.tsx @@ -1,5 +1,6 @@ import { TinyColor } from '@ctrl/tinycolor'; -import React, { useMemo } from 'react'; +import * as React from 'react'; +import { useMemo } from 'react'; import { useToken } from '../theme/internal'; const Simple: React.FC = () => { diff --git a/components/float-button/PurePanel.tsx b/components/float-button/PurePanel.tsx index 6cf10b0aa3..2732a06331 100644 --- a/components/float-button/PurePanel.tsx +++ b/components/float-button/PurePanel.tsx @@ -1,5 +1,5 @@ /* eslint-disable react/no-array-index-key */ -import React from 'react'; +import * as React from 'react'; import classNames from 'classnames'; import FloatButton, { floatButtonPrefixCls } from './FloatButton'; import FloatButtonGroup from './FloatButtonGroup'; diff --git a/components/form/ErrorList.tsx b/components/form/ErrorList.tsx index ed733cac58..8893e9375b 100644 --- a/components/form/ErrorList.tsx +++ b/components/form/ErrorList.tsx @@ -1,9 +1,10 @@ import classNames from 'classnames'; import CSSMotion, { CSSMotionList } from 'rc-motion'; -import React, { useMemo } from 'react'; +import * as React from 'react'; +import { useMemo } from 'react'; import initCollapseMotion from '../_util/motion'; -import type { ValidateStatus } from './FormItem'; import { FormItemPrefixContext } from './context'; +import type { ValidateStatus } from './FormItem'; import useDebounce from './hooks/useDebounce'; import useStyle from './style'; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 303befb099..d18a7ac943 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -2,7 +2,8 @@ import classNames from 'classnames'; import FieldForm, { List, useWatch } from 'rc-field-form'; import type { FormProps as RcFormProps } from 'rc-field-form/lib/Form'; import type { InternalNamePath, ValidateErrorEntity } from 'rc-field-form/lib/interface'; -import React, { useMemo } from 'react'; +import * as React from 'react'; +import { useMemo } from 'react'; import type { Options } from 'scroll-into-view-if-needed'; import { ConfigContext } from '../config-provider'; import DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext'; diff --git a/components/form/FormItem/ItemHolder.tsx b/components/form/FormItem/ItemHolder.tsx index 584541432f..d338594325 100644 --- a/components/form/FormItem/ItemHolder.tsx +++ b/components/form/FormItem/ItemHolder.tsx @@ -7,7 +7,7 @@ import type { Meta } from 'rc-field-form/lib/interface'; import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; import isVisible from 'rc-util/lib/Dom/isVisible'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import type { FormItemProps, ValidateStatus } from '.'; import { Row } from '../../grid'; import FormItemInput from '../FormItemInput'; diff --git a/components/form/FormItem/index.tsx b/components/form/FormItem/index.tsx index f2d326ed0e..68127ed505 100644 --- a/components/form/FormItem/index.tsx +++ b/components/form/FormItem/index.tsx @@ -5,7 +5,7 @@ import type { FieldProps } from 'rc-field-form/lib/Field'; import type { Meta, NamePath } from 'rc-field-form/lib/interface'; import useState from 'rc-util/lib/hooks/useState'; import { supportRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import { cloneElement, isValidElement } from '../../_util/reactNode'; import warning from '../../_util/warning'; import { ConfigContext } from '../../config-provider'; diff --git a/components/form/FormItemInput.tsx b/components/form/FormItemInput.tsx index 2f0a35f5a1..c81a5ce4da 100644 --- a/components/form/FormItemInput.tsx +++ b/components/form/FormItemInput.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { ColProps } from '../grid/col'; import Col from '../grid/col'; import { FormContext, FormItemPrefixContext } from './context'; diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index d8fac1b25e..a8f4dace0e 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -1,6 +1,6 @@ import QuestionCircleOutlined from '@ant-design/icons/QuestionCircleOutlined'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { ColProps } from '../grid/col'; import Col from '../grid/col'; import defaultLocale from '../locale/en_US'; diff --git a/components/form/FormList.tsx b/components/form/FormList.tsx index 89d3616082..eaff6f5520 100644 --- a/components/form/FormList.tsx +++ b/components/form/FormList.tsx @@ -1,6 +1,6 @@ import { List } from 'rc-field-form'; import type { StoreValue, ValidatorRule } from 'rc-field-form/lib/interface'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; import { FormItemPrefixContext } from './context'; diff --git a/components/form/__tests__/demo.test.tsx b/components/form/__tests__/demo.test.tsx index 53a4e5df03..d7ab665e7b 100644 --- a/components/form/__tests__/demo.test.tsx +++ b/components/form/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('form', { skip: ['complex-form-control.tsx', 'dep-debug.tsx'] }); diff --git a/components/form/context.tsx b/components/form/context.tsx index fc4f1d4b7f..ed6bb91f66 100644 --- a/components/form/context.tsx +++ b/components/form/context.tsx @@ -3,7 +3,8 @@ import type { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib import type { Meta } from 'rc-field-form/lib/interface'; import omit from 'rc-util/lib/omit'; import type { FC, PropsWithChildren, ReactNode } from 'react'; -import React, { useContext, useMemo } from 'react'; +import * as React from 'react'; +import { useContext, useMemo } from 'react'; import type { ColProps } from '../grid/col'; import type { FormInstance, RequiredMark } from './Form'; import type { ValidateStatus } from './FormItem'; diff --git a/components/form/hooks/useDebounce.ts b/components/form/hooks/useDebounce.ts index 65940778b5..ded2dcb1b3 100644 --- a/components/form/hooks/useDebounce.ts +++ b/components/form/hooks/useDebounce.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export default function useDebounce(value: T[]): T[] { const [cacheValue, setCacheValue] = React.useState(value); diff --git a/components/form/hooks/useForm.ts b/components/form/hooks/useForm.ts index f2031edd94..a553a58902 100644 --- a/components/form/hooks/useForm.ts +++ b/components/form/hooks/useForm.ts @@ -1,6 +1,6 @@ import type { FormInstance as RcFormInstance } from 'rc-field-form'; import { useForm as useRcForm } from 'rc-field-form'; -import React from 'react'; +import * as React from 'react'; import scrollIntoView from 'scroll-into-view-if-needed'; import type { InternalNamePath, NamePath, ScrollOptions } from '../interface'; import { getFieldId, toArray } from '../util'; diff --git a/components/form/hooks/useFrameState.ts b/components/form/hooks/useFrameState.ts index 41a8e112d8..12fbc587c1 100644 --- a/components/form/hooks/useFrameState.ts +++ b/components/form/hooks/useFrameState.ts @@ -1,5 +1,6 @@ import raf from 'rc-util/lib/raf'; -import React, { useRef } from 'react'; +import * as React from 'react'; +import { useRef } from 'react'; type Updater = (prev?: ValueType) => ValueType; diff --git a/components/form/hooks/useItemRef.ts b/components/form/hooks/useItemRef.ts index d3ddb858f2..e42890677d 100644 --- a/components/form/hooks/useItemRef.ts +++ b/components/form/hooks/useItemRef.ts @@ -1,5 +1,5 @@ import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import { FormContext } from '../context'; import type { InternalNamePath } from '../interface'; diff --git a/components/grid/col.tsx b/components/grid/col.tsx index 83b725d492..ead96e4913 100644 --- a/components/grid/col.tsx +++ b/components/grid/col.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import RowContext from './RowContext'; import { useColStyle } from './style'; diff --git a/components/grid/row.tsx b/components/grid/row.tsx index 5770528e6a..c4fea7486c 100644 --- a/components/grid/row.tsx +++ b/components/grid/row.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; import type { Breakpoint, ScreenMap } from '../_util/responsiveObserver'; diff --git a/components/image/PreviewGroup.tsx b/components/image/PreviewGroup.tsx index 7a95b2aff6..136843e2c5 100644 --- a/components/image/PreviewGroup.tsx +++ b/components/image/PreviewGroup.tsx @@ -8,7 +8,7 @@ import ZoomInOutlined from '@ant-design/icons/ZoomInOutlined'; import ZoomOutOutlined from '@ant-design/icons/ZoomOutOutlined'; import RcImage from 'rc-image'; import type { GroupConsumerProps } from 'rc-image/lib/PreviewGroup'; -import React from 'react'; +import * as React from 'react'; import classNames from 'classnames'; import { ConfigContext } from '../config-provider'; import { getTransitionName } from '../_util/motion'; diff --git a/components/image/index.tsx b/components/image/index.tsx index 941c93d6a9..09a58b7b1a 100644 --- a/components/image/index.tsx +++ b/components/image/index.tsx @@ -1,7 +1,7 @@ import EyeOutlined from '@ant-design/icons/EyeOutlined'; import classNames from 'classnames'; import RcImage, { type ImageProps } from 'rc-image'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import defaultLocale from '../locale/en_US'; import { getTransitionName } from '../_util/motion'; diff --git a/components/input-number/__tests__/demo.test.tsx b/components/input-number/__tests__/demo.test.tsx index b8977fda38..4b6a47dad4 100644 --- a/components/input-number/__tests__/demo.test.tsx +++ b/components/input-number/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('input-number'); diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index 2e5c21bb1e..0afd07132f 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -4,7 +4,7 @@ import type { ValueType } from '@rc-component/mini-decimal'; import classNames from 'classnames'; import type { InputNumberProps as RcInputNumberProps } from 'rc-input-number'; import RcInputNumber from 'rc-input-number'; -import React from 'react'; +import * as React from 'react'; import ConfigProvider, { ConfigContext } from '../config-provider'; import DisabledContext from '../config-provider/DisabledContext'; import type { SizeType } from '../config-provider/SizeContext'; diff --git a/components/input/Group.tsx b/components/input/Group.tsx index 7f8d8d78a1..fbb3063923 100644 --- a/components/input/Group.tsx +++ b/components/input/Group.tsx @@ -1,9 +1,10 @@ import classNames from 'classnames'; -import React, { useContext, useMemo } from 'react'; -import warning from '../_util/warning'; +import * as React from 'react'; +import { useContext, useMemo } from 'react'; import { ConfigContext } from '../config-provider'; import type { FormItemStatusContextProps } from '../form/context'; import { FormItemInputContext } from '../form/context'; +import warning from '../_util/warning'; import useStyle from './style'; export interface GroupProps { diff --git a/components/input/Password.tsx b/components/input/Password.tsx index fc00b230d2..d2de855f80 100644 --- a/components/input/Password.tsx +++ b/components/input/Password.tsx @@ -3,12 +3,13 @@ import EyeOutlined from '@ant-design/icons/EyeOutlined'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; import { composeRef } from 'rc-util/lib/ref'; -import React, { useRef, useState } from 'react'; +import * as React from 'react'; +import { useRef, useState } from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; +import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout'; import type { InputProps, InputRef } from './Input'; import Input from './Input'; -import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout'; const defaultIconRender = (visible: boolean): React.ReactNode => visible ? : ; diff --git a/components/input/Search.tsx b/components/input/Search.tsx index bba8455dde..770e310bfe 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -1,7 +1,7 @@ import SearchOutlined from '@ant-design/icons/SearchOutlined'; import classNames from 'classnames'; import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import Button from '../button'; import { ConfigContext } from '../config-provider'; import SizeContext from '../config-provider/SizeContext'; diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index 5a42094a94..44a2e818bc 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -1,20 +1,21 @@ -import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; -import classNames from 'classnames'; -import type { BaseInputProps } from 'rc-input/lib/interface'; +import type { TextAreaProps as RcTextAreaProps } from 'rc-textarea/lib/interface'; import type { TextAreaRef as RcTextAreaRef } from 'rc-textarea'; +import { forwardRef } from 'react'; +import * as React from 'react'; import RcTextArea from 'rc-textarea'; -import type { TextAreaProps as RcTextAreaProps } from 'rc-textarea/lib/interface'; -import React, { forwardRef } from 'react'; -import type { InputStatus } from '../_util/statusUtils'; -import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; -import { ConfigContext } from '../config-provider'; -import DisabledContext from '../config-provider/DisabledContext'; +import classNames from 'classnames'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import type { BaseInputProps } from 'rc-input/lib/interface'; +import { FormItemInputContext } from '../form/context'; +import useStyle from './style'; import type { SizeType } from '../config-provider/SizeContext'; import SizeContext from '../config-provider/SizeContext'; -import { FormItemInputContext } from '../form/context'; +import type { InputStatus } from '../_util/statusUtils'; +import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; import type { InputFocusOptions } from './Input'; import { triggerFocus } from './Input'; -import useStyle from './style'; +import DisabledContext from '../config-provider/DisabledContext'; +import { ConfigContext } from '../config-provider'; export interface TextAreaProps extends Omit { bordered?: boolean; diff --git a/components/input/__tests__/demo.test.tsx b/components/input/__tests__/demo.test.tsx index 232a98204e..4be9097dab 100644 --- a/components/input/__tests__/demo.test.tsx +++ b/components/input/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('input'); diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index 46e0841f15..4df4f05478 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -3,9 +3,11 @@ import LeftOutlined from '@ant-design/icons/LeftOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React, { useContext, useEffect, useRef, useState } from 'react'; -import isNumeric from '../_util/isNumeric'; +import * as React from 'react'; +import { useContext, useEffect, useRef, useState } from 'react'; + import { ConfigContext } from '../config-provider'; +import isNumeric from '../_util/isNumeric'; import { LayoutContext } from './layout'; const dimensionMaxMap = { diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx index 9de948a67c..fa9b41487d 100644 --- a/components/layout/layout.tsx +++ b/components/layout/layout.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useStyle from './style'; diff --git a/components/list/index.tsx b/components/list/index.tsx index 8e7c843d69..73a7a2f467 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; // eslint-disable-next-line import/no-named-as-default -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty'; import { Row } from '../grid'; diff --git a/components/locale/index.tsx b/components/locale/index.tsx index 57c1235f2a..34f75c9a26 100644 --- a/components/locale/index.tsx +++ b/components/locale/index.tsx @@ -1,5 +1,5 @@ import type { ValidateMessages } from 'rc-field-form/lib/interface'; -import React from 'react'; +import * as React from 'react'; import warning from '../_util/warning'; import type { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker'; import type { TransferLocale as TransferLocaleForEmpty } from '../empty'; diff --git a/components/locale/useLocale.ts b/components/locale/useLocale.ts index ad4704464e..69be9bc409 100644 --- a/components/locale/useLocale.ts +++ b/components/locale/useLocale.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { Locale } from '.'; import type { LocaleContextProps } from './context'; import LocaleContext from './context'; diff --git a/components/mentions/__tests__/demo.test.tsx b/components/mentions/__tests__/demo.test.tsx index 947a2c85e1..1d7e528071 100644 --- a/components/mentions/__tests__/demo.test.tsx +++ b/components/mentions/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; import { fireEvent } from '../../../tests/utils'; diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 354fd41a9a..a40a8e23f4 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -7,7 +7,7 @@ import type { } from 'rc-mentions/lib/Mentions'; import { composeRef } from 'rc-util/lib/ref'; // eslint-disable-next-line import/no-named-as-default -import React from 'react'; +import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; diff --git a/components/menu/MenuDivider.tsx b/components/menu/MenuDivider.tsx index 75948880f3..1441481bec 100644 --- a/components/menu/MenuDivider.tsx +++ b/components/menu/MenuDivider.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { Divider } from 'rc-menu'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; export interface MenuDividerProps extends React.HTMLAttributes { diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 74ce65aa81..aa1273e2fa 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -3,12 +3,12 @@ import type { MenuItemProps as RcMenuItemProps } from 'rc-menu'; import { Item } from 'rc-menu'; import toArray from 'rc-util/lib/Children/toArray'; import omit from 'rc-util/lib/omit'; -import React from 'react'; -import { cloneElement, isValidElement } from '../_util/reactNode'; +import * as React from 'react'; import type { SiderContextProps } from '../layout/Sider'; import { SiderContext } from '../layout/Sider'; import type { TooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; +import { cloneElement, isValidElement } from '../_util/reactNode'; import type { MenuContextProps } from './MenuContext'; import MenuContext from './MenuContext'; diff --git a/components/menu/OverrideContext.tsx b/components/menu/OverrideContext.tsx index 18c906f39f..ba663f69f5 100644 --- a/components/menu/OverrideContext.tsx +++ b/components/menu/OverrideContext.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { MenuProps } from './menu'; // Used for Dropdown only diff --git a/components/menu/SubMenu.tsx b/components/menu/SubMenu.tsx index bf293163f9..1ae6b50840 100644 --- a/components/menu/SubMenu.tsx +++ b/components/menu/SubMenu.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { SubMenu as RcSubMenu, useFullPath } from 'rc-menu'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { cloneElement, isValidElement } from '../_util/reactNode'; import type { MenuContextProps, MenuTheme } from './MenuContext'; import MenuContext from './MenuContext'; diff --git a/components/menu/__tests__/demo.test.tsx b/components/menu/__tests__/demo.test.tsx index 8fe70822e9..8edf31440a 100644 --- a/components/menu/__tests__/demo.test.tsx +++ b/components/menu/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('menu', { testRootProps: false }); diff --git a/components/menu/hooks/useItems.tsx b/components/menu/hooks/useItems.tsx index 6a5e65311d..dbffab2467 100644 --- a/components/menu/hooks/useItems.tsx +++ b/components/menu/hooks/useItems.tsx @@ -5,7 +5,7 @@ import type { MenuItemType as RcMenuItemType, SubMenuType as RcSubMenuType, } from 'rc-menu/lib/interface'; -import React from 'react'; +import * as React from 'react'; import MenuDivider from '../MenuDivider'; import MenuItem from '../MenuItem'; import SubMenu from '../SubMenu'; diff --git a/components/menu/index.tsx b/components/menu/index.tsx index bbafaa55fc..4c30d2edc6 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -1,6 +1,7 @@ import type { MenuRef as RcMenuRef } from 'rc-menu'; import { ItemGroup } from 'rc-menu'; -import React, { forwardRef, useImperativeHandle, useRef } from 'react'; +import * as React from 'react'; +import { forwardRef, useImperativeHandle, useRef } from 'react'; import type { MenuProps } from './menu'; import InternalMenu from './menu'; import { SiderContext } from '../layout/Sider'; diff --git a/components/menu/menu.tsx b/components/menu/menu.tsx index a8254230e1..7f0e0e052d 100644 --- a/components/menu/menu.tsx +++ b/components/menu/menu.tsx @@ -1,21 +1,22 @@ -import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; -import classNames from 'classnames'; import type { MenuProps as RcMenuProps, MenuRef as RcMenuRef } from 'rc-menu'; import RcMenu from 'rc-menu'; -import useEvent from 'rc-util/lib/hooks/useEvent'; +import * as React from 'react'; +import { forwardRef } from 'react'; import omit from 'rc-util/lib/omit'; -import React, { forwardRef } from 'react'; +import useEvent from 'rc-util/lib/hooks/useEvent'; +import classNames from 'classnames'; +import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; +import warning from '../_util/warning'; import initCollapseMotion from '../_util/motion'; import { cloneElement } from '../_util/reactNode'; -import warning from '../_util/warning'; -import { ConfigContext } from '../config-provider'; import type { SiderContextProps } from '../layout/Sider'; -import type { MenuContextProps, MenuTheme } from './MenuContext'; -import MenuContext from './MenuContext'; +import { ConfigContext } from '../config-provider'; +import useStyle from './style'; import OverrideContext from './OverrideContext'; -import type { ItemType } from './hooks/useItems'; import useItems from './hooks/useItems'; -import useStyle from './style'; +import type { ItemType } from './hooks/useItems'; +import MenuContext from './MenuContext'; +import type { MenuTheme, MenuContextProps } from './MenuContext'; export interface MenuProps extends Omit { theme?: MenuTheme; diff --git a/components/message/PurePanel.tsx b/components/message/PurePanel.tsx index 5dceb785b6..7b9e467b7d 100644 --- a/components/message/PurePanel.tsx +++ b/components/message/PurePanel.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; diff --git a/components/message/index.tsx b/components/message/index.tsx index 1e07d34a93..c005728462 100755 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -1,5 +1,5 @@ import { render } from 'rc-util/lib/React/render'; -import React from 'react'; +import * as React from 'react'; import ConfigProvider, { globalConfig, warnContext } from '../config-provider'; import type { ArgsProps, diff --git a/components/message/useMessage.tsx b/components/message/useMessage.tsx index bfa6db9d65..e5242166b2 100644 --- a/components/message/useMessage.tsx +++ b/components/message/useMessage.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { useNotification as useRcNotification } from 'rc-notification'; import type { NotificationAPI } from 'rc-notification/lib'; import classNames from 'classnames'; diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index 7e1cb074e0..84f36b22d2 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -3,7 +3,7 @@ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import ConfigProvider from '../config-provider'; import { useLocale } from '../locale'; import ActionButton from '../_util/ActionButton'; diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 4a542de49e..4bf98b2f8a 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import Dialog from 'rc-dialog'; -import React from 'react'; +import * as React from 'react'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import type { DirectionType } from '../config-provider'; import { ConfigContext } from '../config-provider'; diff --git a/components/modal/PurePanel.tsx b/components/modal/PurePanel.tsx index e6377eff6c..fe8c085e5d 100644 --- a/components/modal/PurePanel.tsx +++ b/components/modal/PurePanel.tsx @@ -3,7 +3,7 @@ import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import { Panel } from 'rc-dialog'; import type { PanelProps } from 'rc-dialog/lib/Dialog/Content/Panel'; -import React from 'react'; +import * as React from 'react'; import Button from '../button'; import { convertLegacyProps } from '../button/button'; import { ConfigContext } from '../config-provider'; diff --git a/components/modal/__tests__/confirm.test.tsx b/components/modal/__tests__/confirm.test.tsx index 50fba8335c..cc1578817b 100644 --- a/components/modal/__tests__/confirm.test.tsx +++ b/components/modal/__tests__/confirm.test.tsx @@ -3,7 +3,7 @@ import CSSMotion from 'rc-motion'; import { genCSSMotion } from 'rc-motion/lib/CSSMotion'; import KeyCode from 'rc-util/lib/KeyCode'; import { resetWarned } from 'rc-util/lib/warning'; -import React from 'react'; +import * as React from 'react'; import TestUtils from 'react-dom/test-utils'; import type { ModalFuncProps } from '..'; import Modal from '..'; diff --git a/components/modal/__tests__/demo.test.tsx b/components/modal/__tests__/demo.test.tsx index c38fad541e..e02e3b6d82 100644 --- a/components/modal/__tests__/demo.test.tsx +++ b/components/modal/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('modal', { diff --git a/components/modal/__tests__/static-warning.test.tsx b/components/modal/__tests__/static-warning.test.tsx index b4157a47be..af26595b61 100644 --- a/components/modal/__tests__/static-warning.test.tsx +++ b/components/modal/__tests__/static-warning.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Modal from '..'; import { render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/modal/__tests__/type.test.tsx b/components/modal/__tests__/type.test.tsx index fc525505eb..8276ec7cef 100644 --- a/components/modal/__tests__/type.test.tsx +++ b/components/modal/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Modal from '..'; describe('Modal.typescript', () => { diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index ff2e544528..287a3ae9d3 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -1,5 +1,5 @@ import { render as reactRender, unmount as reactUnmount } from 'rc-util/lib/React/render'; -import React from 'react'; +import * as React from 'react'; import { globalConfig, warnContext } from '../config-provider'; import warning from '../_util/warning'; import ConfirmDialog from './ConfirmDialog'; diff --git a/components/modal/useModal/HookModal.tsx b/components/modal/useModal/HookModal.tsx index 2c315ee2ac..d1e699fdc5 100644 --- a/components/modal/useModal/HookModal.tsx +++ b/components/modal/useModal/HookModal.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../../config-provider'; import defaultLocale from '../../locale/en_US'; import useLocale from '../../locale/useLocale'; diff --git a/components/modal/useModal/index.tsx b/components/modal/useModal/index.tsx index 04e2842e70..ce4b1e55a8 100644 --- a/components/modal/useModal/index.tsx +++ b/components/modal/useModal/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import usePatchElement from '../../_util/hooks/usePatchElement'; import type { ModalStaticFunctions } from '../confirm'; import { withConfirm, withError, withInfo, withSuccess, withWarn } from '../confirm'; diff --git a/components/notification/PurePanel.tsx b/components/notification/PurePanel.tsx index ee28edbf74..56ef07e342 100644 --- a/components/notification/PurePanel.tsx +++ b/components/notification/PurePanel.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; diff --git a/components/notification/index.tsx b/components/notification/index.tsx index 03065638b6..00f6985c03 100755 --- a/components/notification/index.tsx +++ b/components/notification/index.tsx @@ -1,5 +1,5 @@ import { render } from 'rc-util/lib/React/render'; -import React from 'react'; +import * as React from 'react'; import ConfigProvider, { globalConfig, warnContext } from '../config-provider'; import type { ArgsProps, GlobalConfigProps, NotificationInstance } from './interface'; import PurePanel from './PurePanel'; diff --git a/components/notification/useNotification.tsx b/components/notification/useNotification.tsx index d50587b5bd..d19b3ff8d6 100644 --- a/components/notification/useNotification.tsx +++ b/components/notification/useNotification.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { useNotification as useRcNotification } from 'rc-notification'; import type { NotificationAPI } from 'rc-notification/lib'; import classNames from 'classnames'; diff --git a/components/pagination/Pagination.tsx b/components/pagination/Pagination.tsx index 9cb662b1ad..2b90f531fe 100644 --- a/components/pagination/Pagination.tsx +++ b/components/pagination/Pagination.tsx @@ -6,7 +6,7 @@ import classNames from 'classnames'; import type { PaginationLocale, PaginationProps as RcPaginationProps } from 'rc-pagination'; import RcPagination from 'rc-pagination'; import enUS from 'rc-pagination/lib/locale/en_US'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useBreakpoint from '../grid/hooks/useBreakpoint'; import { useLocale } from '../locale'; diff --git a/components/pagination/Select.tsx b/components/pagination/Select.tsx index a48c2c4afc..b0cec749a2 100644 --- a/components/pagination/Select.tsx +++ b/components/pagination/Select.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { SelectProps } from '../select'; import Select from '../select'; diff --git a/components/popconfirm/PurePanel.tsx b/components/popconfirm/PurePanel.tsx index 474648b3ed..52b21eaaf6 100644 --- a/components/popconfirm/PurePanel.tsx +++ b/components/popconfirm/PurePanel.tsx @@ -1,6 +1,6 @@ import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { PopconfirmProps } from '.'; import Button from '../button'; import { convertLegacyProps } from '../button/button'; diff --git a/components/popconfirm/__tests__/demo.test.tsx b/components/popconfirm/__tests__/demo.test.tsx index f89cbd3f87..ae0f7f0816 100644 --- a/components/popconfirm/__tests__/demo.test.tsx +++ b/components/popconfirm/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('popconfirm', { diff --git a/components/popconfirm/__tests__/type.test.tsx b/components/popconfirm/__tests__/type.test.tsx index d83cbdbd63..938e790f2c 100644 --- a/components/popconfirm/__tests__/type.test.tsx +++ b/components/popconfirm/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Popconfirm from '..'; describe('Popconfirm.typescript', () => { diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index b7e9535717..d8c4aa1ed3 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -2,7 +2,7 @@ import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import classNames from 'classnames'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import KeyCode from 'rc-util/lib/KeyCode'; -import React from 'react'; +import * as React from 'react'; import omit from 'rc-util/lib/omit'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import { ConfigContext } from '../config-provider'; diff --git a/components/popover/PurePanel.tsx b/components/popover/PurePanel.tsx index d51ee0fdf3..29259c7f15 100644 --- a/components/popover/PurePanel.tsx +++ b/components/popover/PurePanel.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { Popup } from 'rc-tooltip'; -import React from 'react'; +import * as React from 'react'; import type { PopoverProps } from '.'; import { ConfigContext } from '../config-provider'; diff --git a/components/popover/__tests__/demo.test.tsx b/components/popover/__tests__/demo.test.tsx index 948926e348..b02c927e55 100644 --- a/components/popover/__tests__/demo.test.tsx +++ b/components/popover/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('popover', { diff --git a/components/popover/index.tsx b/components/popover/index.tsx index 6980940a50..225c344d92 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { AbstractTooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index e05d710f0b..06cb3acb16 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import type { ProgressProps as RcProgressProps } from 'rc-progress'; import { Circle as RCCircle } from 'rc-progress'; -import React from 'react'; +import * as React from 'react'; import Tooltip from '../tooltip'; import type { ProgressGradient, ProgressProps } from './progress'; import { getPercentage, getSize, getStrokeColor } from './utils'; diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index 4552e10060..1e1db33a7b 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -1,7 +1,7 @@ import { presetPrimaryColors } from '@ant-design/colors'; -import React from 'react'; -import warning from '../_util/warning'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; +import warning from '../_util/warning'; import type { ProgressGradient, ProgressProps, StringGradients } from './progress'; import { getSize, getSuccessPercent, validProgress } from './utils'; diff --git a/components/progress/Steps.tsx b/components/progress/Steps.tsx index 4bdd98f535..85f7c27b59 100644 --- a/components/progress/Steps.tsx +++ b/components/progress/Steps.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { ProgressProps } from './progress'; import { getSize } from './utils'; diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index 7448f73423..5a28175659 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -4,10 +4,10 @@ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; -import warning from '../_util/warning'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; +import warning from '../_util/warning'; import Circle from './Circle'; import Line from './Line'; import Steps from './Steps'; diff --git a/components/radio/__tests__/demo.test.tsx b/components/radio/__tests__/demo.test.tsx index 0003619ffb..720cdbde0b 100644 --- a/components/radio/__tests__/demo.test.tsx +++ b/components/radio/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('radio'); diff --git a/components/radio/context.tsx b/components/radio/context.tsx index 4383af5dbe..46cf29de64 100644 --- a/components/radio/context.tsx +++ b/components/radio/context.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { RadioGroupContextProps, RadioOptionTypeContextProps } from './interface'; const RadioGroupContext = React.createContext(null); diff --git a/components/radio/group.tsx b/components/radio/group.tsx index 581c764469..7e8433d7e1 100644 --- a/components/radio/group.tsx +++ b/components/radio/group.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import SizeContext from '../config-provider/SizeContext'; import getDataOrAriaProps from '../_util/getDataOrAriaProps'; diff --git a/components/radio/radio.tsx b/components/radio/radio.tsx index 8615a302a1..d2b786682c 100644 --- a/components/radio/radio.tsx +++ b/components/radio/radio.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import type { CheckboxRef } from 'rc-checkbox'; import RcCheckbox from 'rc-checkbox'; import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import DisabledContext from '../config-provider/DisabledContext'; import { FormItemInputContext } from '../form/context'; diff --git a/components/radio/radioButton.tsx b/components/radio/radioButton.tsx index 21ad910aa9..1cdf3b6a94 100644 --- a/components/radio/radioButton.tsx +++ b/components/radio/radioButton.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; import { ConfigContext } from '../config-provider'; import { RadioOptionTypeContextProvider } from './context'; diff --git a/components/rate/index.tsx b/components/rate/index.tsx index 8c67a6ca44..2028b8b6fa 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -2,7 +2,7 @@ import StarFilled from '@ant-design/icons/StarFilled'; import classNames from 'classnames'; import RcRate from 'rc-rate'; import type { RateProps as RcRateProps, RateRef } from 'rc-rate/lib/Rate'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import Tooltip from '../tooltip'; import useStyle from './style'; diff --git a/components/result/__tests__/type.test.tsx b/components/result/__tests__/type.test.tsx index 6e877c7f85..14d8f6d7fb 100644 --- a/components/result/__tests__/type.test.tsx +++ b/components/result/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Result from '..'; describe('Result.typescript', () => { diff --git a/components/result/index.tsx b/components/result/index.tsx index 687d0e9179..08041a5ba4 100644 --- a/components/result/index.tsx +++ b/components/result/index.tsx @@ -3,7 +3,7 @@ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import WarningFilled from '@ant-design/icons/WarningFilled'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; diff --git a/components/result/noFound.tsx b/components/result/noFound.tsx index 13872117f5..e18365821f 100644 --- a/components/result/noFound.tsx +++ b/components/result/noFound.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; const NoFound: React.FC = () => ( diff --git a/components/result/serverError.tsx b/components/result/serverError.tsx index f16f24e8b6..a4ed73538e 100644 --- a/components/result/serverError.tsx +++ b/components/result/serverError.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; const ServerError: React.FC = () => ( diff --git a/components/result/unauthorized.tsx b/components/result/unauthorized.tsx index 8202f3a222..7fbc1f2e6e 100644 --- a/components/result/unauthorized.tsx +++ b/components/result/unauthorized.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; const Unauthorized: React.FC = () => ( diff --git a/components/segmented/index.tsx b/components/segmented/index.tsx index da84af0659..49190ae081 100644 --- a/components/segmented/index.tsx +++ b/components/segmented/index.tsx @@ -5,7 +5,7 @@ import type { SegmentedRawOption, } from 'rc-segmented'; import RcSegmented from 'rc-segmented'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SizeType } from '../config-provider/SizeContext'; diff --git a/components/select/__tests__/demo.test.tsx b/components/select/__tests__/demo.test.tsx index 4810b6f6ba..ce4fb72cc7 100644 --- a/components/select/__tests__/demo.test.tsx +++ b/components/select/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('select', { diff --git a/components/select/index.tsx b/components/select/index.tsx index 78830a16ca..4bc74e9540 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -5,7 +5,7 @@ import RcSelect, { OptGroup, Option } from 'rc-select'; import type { OptionProps } from 'rc-select/lib/Option'; import type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; import type { SelectCommonPlacement } from '../_util/motion'; import { getTransitionDirection, getTransitionName } from '../_util/motion'; diff --git a/components/select/utils/iconUtil.tsx b/components/select/utils/iconUtil.tsx index 99d9990c7f..45df8e1072 100644 --- a/components/select/utils/iconUtil.tsx +++ b/components/select/utils/iconUtil.tsx @@ -5,7 +5,7 @@ import DownOutlined from '@ant-design/icons/DownOutlined'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import SearchOutlined from '@ant-design/icons/SearchOutlined'; import type { ReactNode } from 'react'; -import React from 'react'; +import * as React from 'react'; type RenderNode = React.ReactNode | ((props: any) => React.ReactNode); diff --git a/components/skeleton/Avatar.tsx b/components/skeleton/Avatar.tsx index faa74ec4fc..0a7b86d6af 100644 --- a/components/skeleton/Avatar.tsx +++ b/components/skeleton/Avatar.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; diff --git a/components/skeleton/Button.tsx b/components/skeleton/Button.tsx index 23629f9920..10018723b3 100644 --- a/components/skeleton/Button.tsx +++ b/components/skeleton/Button.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; diff --git a/components/skeleton/Element.tsx b/components/skeleton/Element.tsx index bc951fd274..160e07629c 100644 --- a/components/skeleton/Element.tsx +++ b/components/skeleton/Element.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; export interface SkeletonElementProps { prefixCls?: string; diff --git a/components/skeleton/Image.tsx b/components/skeleton/Image.tsx index 068199df33..886aad5c5c 100644 --- a/components/skeleton/Image.tsx +++ b/components/skeleton/Image.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import useStyle from './style'; diff --git a/components/skeleton/Input.tsx b/components/skeleton/Input.tsx index 235924fc67..29b2a84838 100644 --- a/components/skeleton/Input.tsx +++ b/components/skeleton/Input.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; diff --git a/components/skeleton/Node.tsx b/components/skeleton/Node.tsx index bfdf70162a..245bc34791 100644 --- a/components/skeleton/Node.tsx +++ b/components/skeleton/Node.tsx @@ -1,6 +1,6 @@ import DotChartOutlined from '@ant-design/icons/DotChartOutlined'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import useStyle from './style'; diff --git a/components/skeleton/Paragraph.tsx b/components/skeleton/Paragraph.tsx index cbccf0033a..19a6af4b87 100644 --- a/components/skeleton/Paragraph.tsx +++ b/components/skeleton/Paragraph.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; type widthUnit = number | string; diff --git a/components/skeleton/Skeleton.tsx b/components/skeleton/Skeleton.tsx index 4f918b4adb..d799d39374 100644 --- a/components/skeleton/Skeleton.tsx +++ b/components/skeleton/Skeleton.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { AvatarProps } from './Avatar'; import SkeletonAvatar from './Avatar'; diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx index d23e44e3e7..d1aa854030 100644 --- a/components/skeleton/Title.tsx +++ b/components/skeleton/Title.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/heading-has-content */ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; export interface SkeletonTitleProps { prefixCls?: string; diff --git a/components/skeleton/__tests__/demo.test.tsx b/components/skeleton/__tests__/demo.test.tsx index 41ae411473..e7c77fcc9e 100644 --- a/components/skeleton/__tests__/demo.test.tsx +++ b/components/skeleton/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('skeleton'); diff --git a/components/slider/SliderTooltip.tsx b/components/slider/SliderTooltip.tsx index ce337865f2..5cd2a104f3 100644 --- a/components/slider/SliderTooltip.tsx +++ b/components/slider/SliderTooltip.tsx @@ -1,6 +1,7 @@ import raf from 'rc-util/lib/raf'; import { composeRef } from 'rc-util/lib/ref'; -import React, { useRef } from 'react'; +import * as React from 'react'; +import { useRef } from 'react'; import type { TooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; diff --git a/components/slider/__tests__/type.test.tsx b/components/slider/__tests__/type.test.tsx index d30bbd6e2e..b1219a71eb 100644 --- a/components/slider/__tests__/type.test.tsx +++ b/components/slider/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Slider from '..'; describe('Slider.typescript', () => { diff --git a/components/slider/index.tsx b/components/slider/index.tsx index 4c62f0cfbd..545980d7b8 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import type { SliderProps as RcSliderProps } from 'rc-slider'; import RcSlider from 'rc-slider'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { TooltipPlacement } from '../tooltip'; import warning from '../_util/warning'; diff --git a/components/space/Compact.tsx b/components/space/Compact.tsx index d08ae04cea..4168cf1586 100644 --- a/components/space/Compact.tsx +++ b/components/space/Compact.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import React from 'react'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; import { ConfigContext } from '../config-provider'; diff --git a/components/space/Item.tsx b/components/space/Item.tsx index ea6e5b2d8f..68864b1246 100644 --- a/components/space/Item.tsx +++ b/components/space/Item.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { SpaceContext } from '.'; export interface ItemProps { diff --git a/components/space/__tests__/demo.test.tsx b/components/space/__tests__/demo.test.tsx index d5e8d39ecb..31b27af803 100644 --- a/components/space/__tests__/demo.test.tsx +++ b/components/space/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; diff --git a/components/space/index.tsx b/components/space/index.tsx index d0c97d2174..49d34ed761 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SizeType } from '../config-provider/SizeContext'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; diff --git a/components/spin/index.tsx b/components/spin/index.tsx index ae17fff0fe..8527a9a9b9 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { debounce } from 'throttle-debounce'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; import { cloneElement, isValidElement } from '../_util/reactNode'; diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index f68c84da08..4fcd5c95ee 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import useForceUpdate from '../_util/hooks/useForceUpdate'; import { cloneElement } from '../_util/reactNode'; import type { StatisticProps } from './Statistic'; diff --git a/components/statistic/Number.tsx b/components/statistic/Number.tsx index 0ba4d09120..bc5c3d6f5e 100644 --- a/components/statistic/Number.tsx +++ b/components/statistic/Number.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { FormatConfig, valueType } from './utils'; interface NumberProps extends FormatConfig { diff --git a/components/statistic/Statistic.tsx b/components/statistic/Statistic.tsx index 10fbefc5e4..73e1c21716 100644 --- a/components/statistic/Statistic.tsx +++ b/components/statistic/Statistic.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; import Skeleton from '../skeleton'; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 7d6379bcf6..98b6e5184b 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -7,7 +7,7 @@ import type { StepIconRender, StepsProps as RcStepsProps, } from 'rc-steps/lib/Steps'; -import React from 'react'; +import * as React from 'react'; import Tooltip from '../tooltip'; import { ConfigContext } from '../config-provider'; import useBreakpoint from '../grid/hooks/useBreakpoint'; diff --git a/components/steps/useLegacyItems.ts b/components/steps/useLegacyItems.ts index 6d0ecdb494..efa597e3a2 100644 --- a/components/steps/useLegacyItems.ts +++ b/components/steps/useLegacyItems.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import type { StepProps } from '.'; import warning from '../_util/warning'; diff --git a/components/switch/index.tsx b/components/switch/index.tsx index 2d2ba7079a..dd21ff3a12 100755 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -1,7 +1,7 @@ import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import RcSwitch from 'rc-switch'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import DisabledContext from '../config-provider/DisabledContext'; diff --git a/components/table/ExpandIcon.tsx b/components/table/ExpandIcon.tsx index 6cf808036c..64c3f79360 100644 --- a/components/table/ExpandIcon.tsx +++ b/components/table/ExpandIcon.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { TableLocale } from './interface'; interface DefaultExpandIconProps { diff --git a/components/table/InternalTable.tsx b/components/table/InternalTable.tsx index bc890b8ee5..2fa2a9c478 100644 --- a/components/table/InternalTable.tsx +++ b/components/table/InternalTable.tsx @@ -3,7 +3,7 @@ import type { TableProps as RcTableProps } from 'rc-table/lib/Table'; import { INTERNAL_HOOKS } from 'rc-table/lib/Table'; import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import type { Breakpoint } from '../_util/responsiveObserver'; import scrollTo from '../_util/scrollTo'; import warning from '../_util/warning'; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index f5689b8d85..0820749e57 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -1,5 +1,5 @@ import { EXPAND_COLUMN, Summary } from 'rc-table'; -import React from 'react'; +import * as React from 'react'; import Column from './Column'; import ColumnGroup from './ColumnGroup'; import type { TableProps } from './InternalTable'; diff --git a/components/table/__tests__/type.test.tsx b/components/table/__tests__/type.test.tsx index 8d8cbc682d..c1af784d3d 100644 --- a/components/table/__tests__/type.test.tsx +++ b/components/table/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { ColumnProps } from '..'; import type { TreeColumnFilterItem } from '../hooks/useFilter/FilterDropdown'; import Table from '..'; diff --git a/components/table/hooks/useFilter/FilterDropdown.tsx b/components/table/hooks/useFilter/FilterDropdown.tsx index f6d36bc427..7c7358a3a0 100644 --- a/components/table/hooks/useFilter/FilterDropdown.tsx +++ b/components/table/hooks/useFilter/FilterDropdown.tsx @@ -2,7 +2,7 @@ import FilterFilled from '@ant-design/icons/FilterFilled'; import classNames from 'classnames'; import isEqual from 'rc-util/lib/isEqual'; import type { FieldDataNode } from 'rc-tree'; -import React from 'react'; +import * as React from 'react'; import type { MenuProps } from '../../../menu'; import type { FilterState } from '.'; import { flattenKeys } from '.'; diff --git a/components/table/hooks/useFilter/FilterSearch.tsx b/components/table/hooks/useFilter/FilterSearch.tsx index f0f96a2a61..5a837531f3 100644 --- a/components/table/hooks/useFilter/FilterSearch.tsx +++ b/components/table/hooks/useFilter/FilterSearch.tsx @@ -1,5 +1,5 @@ import SearchOutlined from '@ant-design/icons/SearchOutlined'; -import React from 'react'; +import * as React from 'react'; import Input from '../../../input'; import type { FilterSearchType, TableLocale } from '../../interface'; diff --git a/components/table/hooks/useFilter/FilterWrapper.tsx b/components/table/hooks/useFilter/FilterWrapper.tsx index 12f0a9bc3a..d92a1d9fdf 100644 --- a/components/table/hooks/useFilter/FilterWrapper.tsx +++ b/components/table/hooks/useFilter/FilterWrapper.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import KeyCode from 'rc-util/lib/KeyCode'; export interface FilterDropdownMenuWrapperProps { diff --git a/components/table/hooks/useFilter/index.tsx b/components/table/hooks/useFilter/index.tsx index 1056eba9ff..ae58ffe464 100644 --- a/components/table/hooks/useFilter/index.tsx +++ b/components/table/hooks/useFilter/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import warning from '../../../_util/warning'; import type { ColumnFilterItem, diff --git a/components/table/hooks/useLazyKVMap.ts b/components/table/hooks/useLazyKVMap.ts index ae440e2ae0..dd2c362635 100644 --- a/components/table/hooks/useLazyKVMap.ts +++ b/components/table/hooks/useLazyKVMap.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { GetRowKey, Key } from '../interface'; interface MapCache { diff --git a/components/table/hooks/useSelection.tsx b/components/table/hooks/useSelection.tsx index 49103d5c85..9eb92940b3 100644 --- a/components/table/hooks/useSelection.tsx +++ b/components/table/hooks/useSelection.tsx @@ -7,7 +7,8 @@ import { arrAdd, arrDel } from 'rc-tree/lib/util'; import { conductCheck } from 'rc-tree/lib/utils/conductUtil'; import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import React, { useCallback, useMemo, useState } from 'react'; +import * as React from 'react'; +import { useCallback, useMemo, useState } from 'react'; import warning from '../../_util/warning'; import type { CheckboxProps } from '../../checkbox'; import Checkbox from '../../checkbox'; diff --git a/components/table/hooks/useSorter.tsx b/components/table/hooks/useSorter.tsx index 59d4f222de..18eda6cac7 100644 --- a/components/table/hooks/useSorter.tsx +++ b/components/table/hooks/useSorter.tsx @@ -2,7 +2,7 @@ import CaretDownOutlined from '@ant-design/icons/CaretDownOutlined'; import CaretUpOutlined from '@ant-design/icons/CaretUpOutlined'; import classNames from 'classnames'; import KeyCode from 'rc-util/lib/KeyCode'; -import React from 'react'; +import * as React from 'react'; import type { TooltipProps } from '../../tooltip'; import Tooltip from '../../tooltip'; import type { diff --git a/components/table/hooks/useTitleColumns.ts b/components/table/hooks/useTitleColumns.ts index e8c48317e7..4f449b23e4 100644 --- a/components/table/hooks/useTitleColumns.ts +++ b/components/table/hooks/useTitleColumns.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { ColumnsType, ColumnTitleProps, TransformColumns } from '../interface'; import { renderColumnTitle } from '../util'; diff --git a/components/tabs/hooks/useLegacyItems.ts b/components/tabs/hooks/useLegacyItems.ts index 17b113a850..c3da377e1c 100644 --- a/components/tabs/hooks/useLegacyItems.ts +++ b/components/tabs/hooks/useLegacyItems.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import type { Tab } from 'rc-tabs/lib/interface'; import type { TabsProps, TabPaneProps } from '..'; diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 167ae4fca0..55f237c2ef 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import type { TabsProps as RcTabsProps } from 'rc-tabs'; import RcTabs from 'rc-tabs'; import type { EditableConfig } from 'rc-tabs/lib/interface'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SizeType } from '../config-provider/SizeContext'; import SizeContext from '../config-provider/SizeContext'; diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx index 48bcce51cc..b806786c65 100644 --- a/components/tag/CheckableTag.tsx +++ b/components/tag/CheckableTag.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import useStyle from './style'; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 2256eebafc..c3b4ac8fd6 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -1,6 +1,6 @@ import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { PresetColorType, PresetStatusColorType } from '../_util/colors'; import { isPresetColor, isPresetStatusColor } from '../_util/colors'; import type { LiteralUnion } from '../_util/type'; diff --git a/components/theme/__tests__/token.test.tsx b/components/theme/__tests__/token.test.tsx index ef74c3faf7..72d59a1279 100644 --- a/components/theme/__tests__/token.test.tsx +++ b/components/theme/__tests__/token.test.tsx @@ -1,5 +1,5 @@ import { Theme } from '@ant-design/cssinjs'; -import React from 'react'; +import * as React from 'react'; import theme from '..'; import { render, renderHook } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/theme/internal.ts b/components/theme/internal.ts index d83f38ea9b..9faf4ecf9c 100644 --- a/components/theme/internal.ts +++ b/components/theme/internal.ts @@ -17,7 +17,7 @@ import defaultSeedToken from './themes/seed'; import formatToken from './util/alias'; import type { FullToken } from './util/genComponentStyleHook'; import genComponentStyleHook from './util/genComponentStyleHook'; -import statisticToken, { merge as mergeToken, statistic } from './util/statistic'; +import statisticToken, { merge as mergeToken } from './util/statistic'; import genPresetColor from './util/genPresetColor'; const defaultTheme = createTheme(defaultDerivative); @@ -25,8 +25,6 @@ const defaultTheme = createTheme(defaultDerivative); export { // colors PresetColors, - // Statistic - statistic, statisticToken, mergeToken, // hooks diff --git a/components/time-picker/__tests__/demo.test.tsx b/components/time-picker/__tests__/demo.test.tsx index d17fdd8f46..b56475e4c6 100644 --- a/components/time-picker/__tests__/demo.test.tsx +++ b/components/time-picker/__tests__/demo.test.tsx @@ -1,5 +1,5 @@ import dayjs from 'dayjs'; -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('time-picker', { diff --git a/components/time-picker/__tests__/type.test.tsx b/components/time-picker/__tests__/type.test.tsx index 5c589a1d0f..92cdb9ce38 100644 --- a/components/time-picker/__tests__/type.test.tsx +++ b/components/time-picker/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import TimePicker from '..'; describe('TimePicker.typescript', () => { diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index e814840260..909e0c9b77 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -1,5 +1,5 @@ import type { Dayjs } from 'dayjs'; -import React from 'react'; +import * as React from 'react'; import DatePicker from '../date-picker'; import type { PickerTimeProps, RangePickerTimeProps } from '../date-picker/generatePicker'; import genPurePanel from '../_util/PurePanel'; diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index 7778d72d43..6ffead4a5c 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { TimelineItemProps } from './TimelineItem'; import TimelineItemList from './TimelineItemList'; diff --git a/components/timeline/TimelineItem.tsx b/components/timeline/TimelineItem.tsx index ce32db2426..f9e0fcbeee 100644 --- a/components/timeline/TimelineItem.tsx +++ b/components/timeline/TimelineItem.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { LiteralUnion } from '../_util/type'; diff --git a/components/timeline/TimelineItemList.tsx b/components/timeline/TimelineItemList.tsx index abfdfb5cde..d31ad82243 100644 --- a/components/timeline/TimelineItemList.tsx +++ b/components/timeline/TimelineItemList.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import TimelineItem from './TimelineItem'; import type { TimelineProps } from './Timeline'; diff --git a/components/tooltip/PurePanel.tsx b/components/tooltip/PurePanel.tsx index d9468e129a..521fd4a7b1 100644 --- a/components/tooltip/PurePanel.tsx +++ b/components/tooltip/PurePanel.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { Popup } from 'rc-tooltip'; -import React from 'react'; +import * as React from 'react'; import type { TooltipProps } from '.'; import { ConfigContext } from '../config-provider'; diff --git a/components/tooltip/__tests__/demo.test.tsx b/components/tooltip/__tests__/demo.test.tsx index 1cf4081c81..72468220d9 100644 --- a/components/tooltip/__tests__/demo.test.tsx +++ b/components/tooltip/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tooltip', { diff --git a/components/tooltip/__tests__/type.test.tsx b/components/tooltip/__tests__/type.test.tsx index 16e6af7989..e1be478ff3 100644 --- a/components/tooltip/__tests__/type.test.tsx +++ b/components/tooltip/__tests__/type.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Tooltip from '..'; describe('Tooltip.typescript', () => { diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 887b2f54c1..2778a32226 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -1,14 +1,17 @@ -import type { AlignType, BuildInPlacements } from '@rc-component/trigger'; +import type { BuildInPlacements, AlignType } from '@rc-component/trigger'; import classNames from 'classnames'; import RcTooltip from 'rc-tooltip'; +import type { placements as Placements } from 'rc-tooltip/lib/placements'; import type { TooltipProps as RcTooltipProps, TooltipRef as RcTooltipRef, } from 'rc-tooltip/lib/Tooltip'; -import type { placements as Placements } from 'rc-tooltip/lib/placements'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import type { CSSProperties } from 'react'; -import React from 'react'; +import * as React from 'react'; +import { ConfigContext } from '../config-provider'; +import { NoCompactStyle } from '../space/Compact'; +import theme from '../theme'; import type { PresetColorType } from '../_util/colors'; import { getTransitionName } from '../_util/motion'; import type { AdjustOverflow, PlacementsConfig } from '../_util/placements'; @@ -16,9 +19,6 @@ import getPlacements from '../_util/placements'; import { cloneElement, isFragment, isValidElement } from '../_util/reactNode'; import type { LiteralUnion } from '../_util/type'; import warning from '../_util/warning'; -import { ConfigContext } from '../config-provider'; -import { NoCompactStyle } from '../space/Compact'; -import theme from '../theme'; import PurePanel from './PurePanel'; import useStyle from './style'; import { parseColor } from './util'; diff --git a/components/tour/PurePanel.tsx b/components/tour/PurePanel.tsx index 1b7c8f01b2..a6bb5e0b95 100644 --- a/components/tour/PurePanel.tsx +++ b/components/tour/PurePanel.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { RawPurePanel as PopoverRawPurePanel } from '../popover/PurePanel'; import type { TourStepProps } from './interface'; diff --git a/components/tour/__tests__/demo.test.tsx b/components/tour/__tests__/demo.test.tsx index 0dcdb886f6..31d55a5d58 100644 --- a/components/tour/__tests__/demo.test.tsx +++ b/components/tour/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tour', { diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index 0a37574d7f..e57c60c075 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { KeyWiseTransferItem } from '.'; import type { PaginationType } from './interface'; import type { RenderedItem, TransferListProps } from './list'; diff --git a/components/transfer/ListItem.tsx b/components/transfer/ListItem.tsx index a5a173dc64..0bca1a22ff 100644 --- a/components/transfer/ListItem.tsx +++ b/components/transfer/ListItem.tsx @@ -1,6 +1,6 @@ import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import type { KeyWiseTransferItem } from '.'; import Checkbox from '../checkbox'; import defaultLocale from '../locale/en_US'; diff --git a/components/transfer/operation.tsx b/components/transfer/operation.tsx index 9b1cf4c1b7..d8df7ee31e 100644 --- a/components/transfer/operation.tsx +++ b/components/transfer/operation.tsx @@ -1,6 +1,6 @@ import LeftOutlined from '@ant-design/icons/LeftOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; -import React from 'react'; +import * as React from 'react'; import Button from '../button'; import type { DirectionType } from '../config-provider'; diff --git a/components/transfer/search.tsx b/components/transfer/search.tsx index 82e9b6a96f..e5cec43be5 100644 --- a/components/transfer/search.tsx +++ b/components/transfer/search.tsx @@ -1,5 +1,5 @@ import SearchOutlined from '@ant-design/icons/SearchOutlined'; -import React from 'react'; +import * as React from 'react'; import Input from '../input'; diff --git a/components/tree-select/__tests__/demo.test.tsx b/components/tree-select/__tests__/demo.test.tsx index 6b58e254fe..61d664cb8f 100644 --- a/components/tree-select/__tests__/demo.test.tsx +++ b/components/tree-select/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tree-select', { diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index 96720e2bb9..2d95cd67e0 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -5,7 +5,7 @@ import type { TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select'; import RcTreeSelect, { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeNode } from 'rc-tree-select'; import type { BaseOptionType, DefaultOptionType } from 'rc-tree-select/lib/TreeSelect'; import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import genPurePanel from '../_util/PurePanel'; import type { SelectCommonPlacement } from '../_util/motion'; import { getTransitionDirection, getTransitionName } from '../_util/motion'; diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index baed7dc7f3..914973981a 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -7,7 +7,7 @@ import type { BasicDataNode } from 'rc-tree'; import type { DataNode, EventDataNode, Key } from 'rc-tree/lib/interface'; import { conductExpandParent } from 'rc-tree/lib/util'; import { convertDataToEntities, convertTreeToData } from 'rc-tree/lib/utils/treeUtil'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { AntdTreeNodeAttribute, TreeProps } from './Tree'; diff --git a/components/tree/__tests__/type.test.tsx b/components/tree/__tests__/type.test.tsx index 2ee1e99355..3d277b7821 100644 --- a/components/tree/__tests__/type.test.tsx +++ b/components/tree/__tests__/type.test.tsx @@ -1,5 +1,5 @@ import type { BasicDataNode } from 'rc-tree'; -import React from 'react'; +import * as React from 'react'; import { render } from '../../../tests/utils'; import type { DataNode } from '../index'; import Tree from '../index'; diff --git a/components/tree/utils/iconUtil.tsx b/components/tree/utils/iconUtil.tsx index bf0e3cfb9b..83d78d5322 100644 --- a/components/tree/utils/iconUtil.tsx +++ b/components/tree/utils/iconUtil.tsx @@ -4,7 +4,7 @@ import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined'; import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'; import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { cloneElement, isValidElement } from '../../_util/reactNode'; import type { AntTreeNodeProps, SwitcherIcon, TreeLeafIcon } from '../Tree'; diff --git a/components/typography/Base/Ellipsis.tsx b/components/typography/Base/Ellipsis.tsx index 5a8e7c7ce4..d29cd394cd 100644 --- a/components/typography/Base/Ellipsis.tsx +++ b/components/typography/Base/Ellipsis.tsx @@ -1,6 +1,6 @@ import toArray from 'rc-util/lib/Children/toArray'; import useIsomorphicLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; -import React from 'react'; +import * as React from 'react'; export interface EllipsisProps { enabledMeasure?: boolean; diff --git a/components/typography/Base/EllipsisTooltip.tsx b/components/typography/Base/EllipsisTooltip.tsx index f6a8826c2d..35c096a424 100644 --- a/components/typography/Base/EllipsisTooltip.tsx +++ b/components/typography/Base/EllipsisTooltip.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import Tooltip from '../../tooltip'; import type { TooltipProps } from '../../tooltip'; diff --git a/components/typography/Base/index.tsx b/components/typography/Base/index.tsx index 8753171215..9c712fc529 100644 --- a/components/typography/Base/index.tsx +++ b/components/typography/Base/index.tsx @@ -10,7 +10,7 @@ import useIsomorphicLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import omit from 'rc-util/lib/omit'; import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../../config-provider'; import useLocale from '../../locale/useLocale'; import type { TooltipProps } from '../../tooltip'; diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index bbb8cb68b9..e80dd76d11 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -2,7 +2,7 @@ import EnterOutlined from '@ant-design/icons/EnterOutlined'; import classNames from 'classnames'; import type { AutoSizeType } from 'rc-textarea'; import KeyCode from 'rc-util/lib/KeyCode'; -import React from 'react'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; import TextArea from '../input/TextArea'; import type { TextAreaRef } from '../input/TextArea'; diff --git a/components/typography/Link.tsx b/components/typography/Link.tsx index 4de9e490cf..36745f0f31 100644 --- a/components/typography/Link.tsx +++ b/components/typography/Link.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import warning from '../_util/warning'; import type { BlockProps } from './Base'; import Base from './Base'; diff --git a/components/typography/Paragraph.tsx b/components/typography/Paragraph.tsx index 0cb72dddc3..81ae66831a 100644 --- a/components/typography/Paragraph.tsx +++ b/components/typography/Paragraph.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { BlockProps } from './Base'; import Base from './Base'; diff --git a/components/typography/Text.tsx b/components/typography/Text.tsx index 5984ca32ee..1b50b30c03 100644 --- a/components/typography/Text.tsx +++ b/components/typography/Text.tsx @@ -1,5 +1,5 @@ import omit from 'rc-util/lib/omit'; -import React from 'react'; +import * as React from 'react'; import warning from '../_util/warning'; import type { BlockProps, EllipsisConfig } from './Base'; import Base from './Base'; diff --git a/components/typography/Title.tsx b/components/typography/Title.tsx index 90d7cbdd11..926d9f6500 100644 --- a/components/typography/Title.tsx +++ b/components/typography/Title.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import warning from '../_util/warning'; import type { BlockProps } from './Base'; import Base from './Base'; diff --git a/components/typography/Typography.tsx b/components/typography/Typography.tsx index 18de95261d..9b78a906a1 100644 --- a/components/typography/Typography.tsx +++ b/components/typography/Typography.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { composeRef } from 'rc-util/lib/ref'; -import React from 'react'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; import { ConfigContext } from '../config-provider'; import warning from '../_util/warning'; diff --git a/components/typography/__tests__/demo.test.tsx b/components/typography/__tests__/demo.test.tsx index 7434342879..b4ed9129ce 100644 --- a/components/typography/__tests__/demo.test.tsx +++ b/components/typography/__tests__/demo.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('typography'); diff --git a/components/typography/hooks/useMergedConfig.ts b/components/typography/hooks/useMergedConfig.ts index 4ee6a44f43..bd16c97e62 100644 --- a/components/typography/hooks/useMergedConfig.ts +++ b/components/typography/hooks/useMergedConfig.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; export default function useMergedConfig( propConfig: any, diff --git a/components/typography/hooks/useUpdatedEffect.ts b/components/typography/hooks/useUpdatedEffect.ts index 7f4181d350..ec85286161 100644 --- a/components/typography/hooks/useUpdatedEffect.ts +++ b/components/typography/hooks/useUpdatedEffect.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; /** Similar with `useEffect` but only trigger after mounted */ const useUpdatedEffect = (callback: () => void, conditions?: React.DependencyList) => { diff --git a/components/upload/Dragger.tsx b/components/upload/Dragger.tsx index d86f682881..4e6efed30a 100644 --- a/components/upload/Dragger.tsx +++ b/components/upload/Dragger.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import type { UploadProps } from './interface'; import Upload from './Upload'; diff --git a/components/upload/Upload.tsx b/components/upload/Upload.tsx index 5890b4bf7b..d13ffac898 100644 --- a/components/upload/Upload.tsx +++ b/components/upload/Upload.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import type { UploadProps as RcUploadProps } from 'rc-upload'; import RcUpload from 'rc-upload'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import React from 'react'; +import * as React from 'react'; import { flushSync } from 'react-dom'; import { ConfigContext } from '../config-provider'; import DisabledContext from '../config-provider/DisabledContext'; diff --git a/components/upload/UploadList/ListItem.tsx b/components/upload/UploadList/ListItem.tsx index c4d92089a8..3ab5bd121e 100644 --- a/components/upload/UploadList/ListItem.tsx +++ b/components/upload/UploadList/ListItem.tsx @@ -3,7 +3,7 @@ import DownloadOutlined from '@ant-design/icons/DownloadOutlined'; import EyeOutlined from '@ant-design/icons/EyeOutlined'; import classNames from 'classnames'; import CSSMotion from 'rc-motion'; -import React from 'react'; +import * as React from 'react'; import { ConfigContext } from '../../config-provider'; import Progress from '../../progress'; import Tooltip from '../../tooltip'; diff --git a/components/upload/UploadList/index.tsx b/components/upload/UploadList/index.tsx index 8b17ef955c..3151f78e61 100644 --- a/components/upload/UploadList/index.tsx +++ b/components/upload/UploadList/index.tsx @@ -5,7 +5,7 @@ import PictureTwoTone from '@ant-design/icons/PictureTwoTone'; import classNames from 'classnames'; import type { CSSMotionListProps } from 'rc-motion'; import CSSMotion, { CSSMotionList } from 'rc-motion'; -import React from 'react'; +import * as React from 'react'; import type { ButtonProps } from '../../button'; import Button from '../../button'; import { ConfigContext } from '../../config-provider'; diff --git a/docs/react/use-custom-date-library.en-US.md b/docs/react/use-custom-date-library.en-US.md index bce3731f53..54a7f88a36 100644 --- a/docs/react/use-custom-date-library.en-US.md +++ b/docs/react/use-custom-date-library.en-US.md @@ -39,7 +39,7 @@ For example: import { DatePicker } from 'antd'; import type { PickerTimeProps } from 'antd/es/date-picker/generatePicker'; import type { Moment } from 'moment'; -import React from 'react'; +import * as React from 'react'; export interface TimePickerProps extends Omit, 'picker'> {} diff --git a/docs/react/use-custom-date-library.zh-CN.md b/docs/react/use-custom-date-library.zh-CN.md index 70c98271e5..4583fe4b6d 100644 --- a/docs/react/use-custom-date-library.zh-CN.md +++ b/docs/react/use-custom-date-library.zh-CN.md @@ -37,7 +37,7 @@ export default MyDatePicker; import { DatePicker } from 'antd'; import type { PickerTimeProps } from 'antd/es/date-picker/generatePicker'; import type { Moment } from 'moment'; -import React from 'react'; +import * as React from 'react'; export interface TimePickerProps extends Omit, 'picker'> {} diff --git a/package.json b/package.json index 77475c136a..635b404200 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "5.4.6", + "version": "5.4.7", "description": "An enterprise-class UI design language and React components implementation", "title": "Ant Design", "keywords": [ diff --git a/tests/__mocks__/@rc-component/trigger.tsx b/tests/__mocks__/@rc-component/trigger.tsx index 1b02a82db7..b9c9d5c88d 100644 --- a/tests/__mocks__/@rc-component/trigger.tsx +++ b/tests/__mocks__/@rc-component/trigger.tsx @@ -1,6 +1,6 @@ import type { TriggerProps } from '@rc-component/trigger'; import MockTrigger from '@rc-component/trigger/lib/mock'; -import React from 'react'; +import * as React from 'react'; import { TriggerMockContext } from '../../shared/demoTestContext'; let OriginTrigger = jest.requireActual('@rc-component/trigger'); diff --git a/tests/__mocks__/rc-trigger.tsx b/tests/__mocks__/rc-trigger.tsx index de6e7d4583..44631901fe 100644 --- a/tests/__mocks__/rc-trigger.tsx +++ b/tests/__mocks__/rc-trigger.tsx @@ -1,6 +1,6 @@ import type { TriggerProps } from 'rc-trigger'; import MockTrigger from 'rc-trigger/lib/mock'; -import React from 'react'; +import * as React from 'react'; import { TriggerMockContext } from '../shared/demoTestContext'; let OriginTrigger = jest.requireActual('rc-trigger'); diff --git a/tests/shared/demoTest.tsx b/tests/shared/demoTest.tsx index 8b80871bf6..ac120a780e 100644 --- a/tests/shared/demoTest.tsx +++ b/tests/shared/demoTest.tsx @@ -2,7 +2,7 @@ import { createCache, StyleProvider } from '@ant-design/cssinjs'; import { globSync } from 'glob'; import path from 'path'; -import React from 'react'; +import * as React from 'react'; import { renderToString } from 'react-dom/server'; import { render } from '../utils'; import { TriggerMockContext } from './demoTestContext'; diff --git a/tests/shared/demoTestContext.ts b/tests/shared/demoTestContext.ts index 95bfe2791e..f338f36e14 100644 --- a/tests/shared/demoTestContext.ts +++ b/tests/shared/demoTestContext.ts @@ -1,6 +1,6 @@ /* eslint-disable import/prefer-default-export */ import type { TriggerProps } from 'rc-trigger'; -import React from 'react'; +import * as React from 'react'; // We export context here is to avoid testing-lib inject `afterEach` in `tests/index.test.js` // Which breaks the circle deps