diff --git a/components/app/index.tsx b/components/app/index.tsx index cb1eb7a98f..f595d0aa95 100644 --- a/components/app/index.tsx +++ b/components/app/index.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from 'react'; import React, { useContext } from 'react'; import classNames from 'classnames'; -import type { CustomComponent } from '../_util/type'; +import type { AnyObject, CustomComponent } from '../_util/type'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; import useMessage from '../message/useMessage'; @@ -12,18 +12,18 @@ import type { AppConfig, useAppProps } from './context'; import AppContext, { AppConfigContext } from './context'; import useStyle from './style'; -export interface AppProps extends AppConfig { +export interface AppProps

extends AppConfig { style?: React.CSSProperties; className?: string; rootClassName?: string; prefixCls?: string; children?: ReactNode; - component?: false | CustomComponent; + component?: CustomComponent

| false; } const useApp = () => React.useContext(AppContext); -const App: React.FC & { useApp: typeof useApp } = (props) => { +const App: React.FC & { useApp: () => useAppProps } = (props) => { const { prefixCls: customizePrefixCls, children, @@ -66,7 +66,7 @@ const App: React.FC & { useApp: typeof useApp } = (props) => { // ============================ Render ============================ const Component = component === false ? React.Fragment : component; - const rootProps = { + const rootProps: AppProps = { className: customClassName, style, };