fix(useOverlay): don't use patch when passing props to open (#4497)

This commit is contained in:
Eugen Istoc
2025-07-10 04:45:55 -04:00
committed by GitHub
parent d8160ba6ef
commit 5ad7dabbdc

View File

@@ -87,11 +87,11 @@ function _useOverlay() {
const open = <T extends Component>(id: symbol, props?: ComponentProps<T>): OpenedOverlay<T> => {
const overlay = getOverlay(id)
// If props are provided, update the overlay's props
// If props are provided, merge them with the original props, otherwise use the original props
if (props) {
patch(overlay.id, props)
overlay.props = { ...overlay.originalProps, ...props }
} else {
patch(overlay.id, overlay.originalProps)
overlay.props = { ...overlay.originalProps }
}
overlay.isOpen = true