Skip to content

Commit 16a535d

Browse files
committed
restore migration guide for MessageBox
1 parent 92e3e22 commit 16a535d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/MigrationGuide.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,35 @@ function MyComponent() {
263263
}
264264
```
265265

266+
### MessageBox
267+
268+
- `onClose` is now a plain callback function and no `CustomEvent` anymore. It receives two parameters, `action` and `escPressed`.
269+
270+
```jsx
271+
// v1
272+
// onClose?: (event: CustomEvent<{ action: MessageBoxAction }>) => void;
273+
274+
<MessageBox
275+
onClose={(event) => {
276+
console.log(event.detail.action);
277+
}}
278+
>
279+
{children}
280+
</MessageBox>
281+
282+
// v2
283+
// onClose?: (action: MessageBoxActionType | undefined, escPressed?: true) => void;
284+
285+
<MessageBox
286+
onClose={(action, escPressed) => {
287+
console.log(action, escPressed);
288+
}}
289+
>
290+
{children}
291+
</MessageBox>
292+
293+
```
294+
266295
### ObjectPage
267296

268297
The newly introduced `DynamicPage` web component comes with its own `DynamicPageHeader` and `DynamicPageTitle` components, which are unfortunately incompatible with our `ObjectPage` implementation.

0 commit comments

Comments
 (0)