fix(useOverlay): set props to original props when defaultOpen is set (#4308)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Eugen Istoc
2025-06-11 11:05:55 -04:00
committed by GitHub
parent 4873b3a043
commit 66355ba301

View File

@@ -46,7 +46,7 @@ function _useOverlay() {
isMounted: !!defaultOpen,
destroyOnClose: !!destroyOnClose,
originalProps: props || {},
props: {}
props: { ...(props || {}) }
})
overlays.push(options)
@@ -110,9 +110,7 @@ function _useOverlay() {
const patch = <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>): void => {
const overlay = getOverlay(id)
Object.entries(props!).forEach(([key, value]) => {
(overlay.props as any)[key] = value
})
overlay.props = { ...props }
}
const getOverlay = (id: symbol): Overlay => {