TreeSelect <Experimental></Experimental>
<Alert type="error"> This component is going to be rewritten. Please don't use it. </Alert>Install
npm install antd-mobile@5.43.0
antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.
Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.
Demos
TreeSelect
Props
TreeSelect
type TreeSelectOption = {
label: string
value: string
children?: TreeSelectOption[]
}
| Name | Description | Type | Default |
|---|---|---|---|
| defaultValue | Selected options by default | string[] | [] |
| fieldNames | The customized fields of label value children in options | { label?: string; value?: string; children?: string } | {} |
| onChange | Triggered when value is changed | (value: string[], extend: { options: TreeSelectOption[] }) => void | - |
| options | Cascaded data | TreeSelectOption[] | [] |
| value | Selected options | string[] | [] |