Skip to content

Commit

Permalink
fix(layout): fix ErrorBoundary types error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 16, 2023
1 parent b524df0 commit 5bb5be1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/layout/src/ProLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ export type ProLayoutProps = GlobalTypes & {
/**
* @name 错误处理组件
*
* @example ErrorBoundary={<MyErrorBoundary/>}
* @example ErrorBoundary={MyErrorBoundary}
*/
ErrorBoundary?: any;
ErrorBoundary?: React.ComponentClass<any, any> | boolean;

This comment has been minimized.

Copy link
@chenfangsheng

chenfangsheng Apr 11, 2024

类型申明错误,应改为:ErrorBoundary?: React.ReactNode | boolean;


/**
* @name 侧边菜单的类型, menu.type 的快捷方式
Expand Down
1 change: 1 addition & 0 deletions packages/table/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ const ProviderTableContainer = <
props: ProTableProps<DataType, Params, ValueType>,
) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);

const ErrorComponent =
props.ErrorBoundary === false
? React.Fragment
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export type ProTableProps<DataSource, U, ValueType = 'text'> = {
/**
* 错误边界自定义
*/
ErrorBoundary?: any;
ErrorBoundary?: React.ComponentClass<any, any> | false;
} & Omit<TableProps<DataSource>, 'columns' | 'rowSelection'>;

export type ActionType = ProCoreActionType & {
Expand Down

0 comments on commit 5bb5be1

Please sign in to comment.