mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(useOverlay): improve props handling by merging existing and new (#4478)
This commit is contained in:
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user