fix(useOverlay): improve props handling by merging existing and new (#4478)

This commit is contained in:
Eugen Istoc
2025-07-08 04:51:34 -04:00
committed by GitHub
parent da05c37ffe
commit 6519a74de4

View File

@@ -71,7 +71,7 @@ function _useOverlay() {
isMounted: !!defaultOpen, isMounted: !!defaultOpen,
destroyOnClose: !!destroyOnClose, destroyOnClose: !!destroyOnClose,
originalProps: props || {}, originalProps: props || {},
props: { ...(props || {}) } props: { ...props }
}) })
overlays.push(options) overlays.push(options)
@@ -135,7 +135,7 @@ function _useOverlay() {
const patch = <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>): void => { const patch = <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>): void => {
const overlay = getOverlay(id) const overlay = getOverlay(id)
overlay.props = { ...props } overlay.props = { ...overlay.props, ...props }
} }
const getOverlay = (id: symbol): Overlay => { const getOverlay = (id: symbol): Overlay => {