From 16d28e31a253049f5ee0e12ef91a5578a16f737c Mon Sep 17 00:00:00 2001 From: "DM.Zhong" Date: Fri, 9 Nov 2018 08:45:56 +0800 Subject: [PATCH] Update ModalDialog.md --- snippets/ModalDialog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/ModalDialog.md b/snippets/ModalDialog.md index 121e22ac7..e624cd639 100644 --- a/snippets/ModalDialog.md +++ b/snippets/ModalDialog.md @@ -2,12 +2,12 @@ Renders a dialog component with modal. -This is a simple React ModalDialog Component that is called and controlled through events +This is a simple React ModalDialog Component that is called and controlled through events. Benefits from the CustomEvent API,this ModalDialog component supports single instance usage.We just need import `Dialog` once time,and can call the dialog everywhere.Every time we wanna show the dialog,we just call the static function `Dialog.show`.Passing our jsx templates and data as the parameter and then the dialog will show with the data and templates rendered. -After the component mounted,Dialog binds a custom event called 'modal' to document element.The event handler defined in our component named `modalHandler`.It accepts and renders the data passed by users.When document node captured a `modal` event,`modalHandler` works. +After the component mounted,Dialog binds a custom event called `modal` to document element.The event handler defined in our component named `modalHandler`.It accepts and renders the data passed by users.When document node captured a `modal` event,`modalHandler` works. Before the component unmounted,Dialog removes the custom event from document element in case of memory leaks.