Skip to content

Commit

Permalink
fix(dropdown): mergeProp
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe committed Apr 25, 2024
1 parent 5694d42 commit 963fcb7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import React, {
} from 'react'
import { NativeProps, withNativeProps } from '../../utils/native-props'
import { usePropsValue } from '../../utils/use-props-value'
import { mergeProps } from '../../utils/with-default-props'
import { mergeProp, mergeProps } from '../../utils/with-default-props'
import { useConfig } from '../config-provider'
import Popup, { PopupProps } from '../popup'
import { defaultPopupBaseProps } from '../popup/popup-base-props'
Expand Down Expand Up @@ -55,6 +55,11 @@ const Dropdown = forwardRef<DropdownRef, PropsWithChildren<DropdownProps>>(
(props, ref) => {
const { dropdown: componentConfig = {} } = useConfig()
const mergedProps = mergeProps(defaultProps, componentConfig, props)
const arrowIcon = mergeProp(
componentConfig.arrowIcon,
props.arrow,
props.arrowIcon
)
const [value, setValue] = usePropsValue({
value: mergedProps.activeKey,
defaultValue: mergedProps.defaultActiveKey,
Expand Down Expand Up @@ -128,9 +133,7 @@ const Dropdown = forwardRef<DropdownRef, PropsWithChildren<DropdownProps>>(
})}
ref={containerRef}
>
<IconContext.Provider
value={mergedProps.arrowIcon || mergedProps.arrow}
>
<IconContext.Provider value={arrowIcon}>
<div className={`${classPrefix}-nav`} ref={navRef}>
{navs}
</div>
Expand Down

0 comments on commit 963fcb7

Please sign in to comment.