mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(useOverlay): don't use patch when passing props to open (#4497)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user