From 0e726c5e44d3c1335c3c23294c06b9aa75263d23 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 15 Aug 2021 15:25:56 +0200 Subject: [PATCH] [docs] Improve the Modal onClose migration --- .../pages/guides/migration-v4/migration-v4.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/pages/guides/migration-v4/migration-v4.md b/docs/src/pages/guides/migration-v4/migration-v4.md index 6a065c75c2486f..bb4dd04881d5c9 100644 --- a/docs/src/pages/guides/migration-v4/migration-v4.md +++ b/docs/src/pages/guides/migration-v4/migration-v4.md @@ -1127,15 +1127,15 @@ As the core components use emotion as their style engine, the props used by emot > ✅ This is handled in [🪄preset-safe codemod](#preset-safe). ```diff - { - + if (reason !== 'backdropClick') { - + onClose(event, reason); - + } - + }} - /> + { + + if (reason !== 'backdropClick') { + + handleClose(event, reason); + + } + + }} + /> ``` - Remove the `withMobileDialog` higher-order component. The hook API allows a simpler and more flexible solution: @@ -1517,7 +1517,7 @@ As the core components use emotion as their style engine, the props used by emot - onClose={handleClose} + onClose={(event, reason) => { + if (reason !== 'backdropClick') { - + onClose(event, reason); + + handleClose(event, reason); + } + }} />