Repository: ant-design/ant-design-mobile
Pull request #6558 (2024-03-01 03:00:17)

docs:Remove duplicate CSS variables in the English documentation of the Tabs component
Remove duplicate CSS variables in the English documentation of the Tabs component


Patch:
diff --git a/src/components/config-provider/config-provider.tsx b/src/components/config-provider/config-provider.tsx
index 7b4d75f3f..f608e45f5 100644
--- a/src/components/config-provider/config-provider.tsx
+++ b/src/components/config-provider/config-provider.tsx
@@ -5,7 +5,6 @@ import zhCN from '../../locales/zh-CN'
 
 type Config = {
   locale: Locale
-  children?: ReactNode
 }
 
 export const defaultConfigRef: {
@@ -26,7 +25,9 @@ export function getDefaultConfig() {
 
 const ConfigContext = React.createContext<Config | null>(null)
 
-export type ConfigProviderProps = Config
+export type ConfigProviderProps = Config & {
+  children?: ReactNode
+}
 
 export const ConfigProvider: FC<ConfigProviderProps> = props => {
   const { children, ...config } = props
diff --git a/src/components/tabs/index.en.md b/src/components/tabs/index.en.md
index 182c8f6dd..b29cd5de6 100644
--- a/src/components/tabs/index.en.md
+++ b/src/components/tabs/index.en.md
@@ -40,7 +40,6 @@ The current content needs to be divided into groups of the same hierarchical str
 | --active-line-height | The height of the active tab underline | `2px` |
 | --active-title-color | The color of the active tab title | `var(--adm-color-primary)` |
 | --content-padding | Padding of the tab content | `12px` |
-| --content-padding | Padding of the tab content | `12px` |
 | --fixed-active-line-width | The width of the active tab underline. Only take effect when `activeLineMode` is `'fixed'`. | `30px` |
 | --title-font-size | Font size of the displayed text of the tab header | `17px` |
 
diff --git a/src/index.ts b/src/index.ts
index 7f26c66a2..50676a300 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -61,7 +61,7 @@ export type {
 } from './components/checkbox'
 export { default as Collapse } from './components/collapse'
 export type { CollapseProps, CollapsePanelProps } from './components/collapse'
-export { default as ConfigProvider } from './components/config-provider'
+export { default as ConfigProvider, useConfig } from './components/config-provider'
 export type { ConfigProviderProps } from './components/config-provider'
 export { default as DatePicker } from './components/date-picker'
 export type { DatePickerProps, DatePickerRef } from './components/date-picker'


Test patch:
diff --git a/src/components/config-provider/tests/config-provider.test.tsx b/src/components/config-provider/tests/config-provider.test.tsx
index 314db4c8f..8b348b6bc 100644
--- a/src/components/config-provider/tests/config-provider.test.tsx
+++ b/src/components/config-provider/tests/config-provider.test.tsx
@@ -10,6 +10,7 @@ import Form from '../../form'
 import Picker from '../../picker'
 import SearchBar from '../../search-bar'
 import ImageUploader from '../../image-uploader'
+import { useConfig } from '../'
 
 import zhCN from '../../../locales/zh-CN'
 import zhTW from '../../../locales/zh-TW'
@@ -98,4 +99,16 @@ describe('ConfigProvider', () => {
       expect(container).toMatchSnapshot()
     })
   })
+
+  test('useConfig should only has `locale`', () => {
+    let config: ReturnType<typeof useConfig>
+
+    const Demo = () => {
+      config = useConfig()
+      return null
+    }
+    render(<Demo />)
+
+    expect(Object.keys(config!)).toEqual(['locale'])
+  })
 })