From e4ba3ea1c73b660a5e2b89d32f95181287ce3377 Mon Sep 17 00:00:00 2001 From: Dark Date: Mon, 12 Sep 2022 21:53:46 +0800 Subject: [PATCH] fix(antd/next): onChange does not work when no formTab instance is passed (#3388) --- packages/antd/src/form-tab/index.tsx | 2 +- packages/next/src/form-tab/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/antd/src/form-tab/index.tsx b/packages/antd/src/form-tab/index.tsx index 1584f100535..428cc2114fb 100644 --- a/packages/antd/src/form-tab/index.tsx +++ b/packages/antd/src/form-tab/index.tsx @@ -98,7 +98,7 @@ export const FormTab: ComposedFormTab = observer( activeKey={activeKey} onChange={(key) => { props.onChange?.(key) - formTab?.setActiveKey?.(key) + _formTab?.setActiveKey?.(key) }} > {tabs.map(({ props, schema, name }, key) => ( diff --git a/packages/next/src/form-tab/index.tsx b/packages/next/src/form-tab/index.tsx index 52a30fdec67..a788f58cf67 100644 --- a/packages/next/src/form-tab/index.tsx +++ b/packages/next/src/form-tab/index.tsx @@ -102,7 +102,7 @@ export const FormTab: ComposedFormTab = observer( className={cls(prefixCls, props.className)} onChange={(key) => { props.onChange?.(key) - formTab?.setActiveKey?.(key) + _formTab?.setActiveKey?.(key) }} lazyLoad={false} >