diff --git a/index.json b/index.json index 36adfff..d962ca0 100644 --- a/index.json +++ b/index.json @@ -200,7 +200,7 @@ "modal": { "react": true, "icon": true, - "version": "1.2.2", + "version": "1.2.3", "style": true, "test": true, "install": false, diff --git a/src/modal/CHANGELOG.md b/src/modal/CHANGELOG.md index fbbcf1e..664b492 100644 --- a/src/modal/CHANGELOG.md +++ b/src/modal/CHANGELOG.md @@ -1,4 +1,8 @@ -## 1.2.2 (22 Apr 2023) +## 1.2.3 (10 May 2024) + +* fix: react onClose unable to update + +## 1.2.2 (22 Apr 2024) * fix: title shrinked diff --git a/src/modal/package.json b/src/modal/package.json index 261befa..53d930b 100644 --- a/src/modal/package.json +++ b/src/modal/package.json @@ -1,6 +1,6 @@ { "name": "modal", - "version": "1.2.2", + "version": "1.2.3", "description": "Create modal dialogs", "luna": { "react": true, diff --git a/src/modal/react.tsx b/src/modal/react.tsx index 414aa0a..13688ed 100644 --- a/src/modal/react.tsx +++ b/src/modal/react.tsx @@ -54,6 +54,14 @@ const LunaModal: FC> = (props) => { }, [props[key]]) }) + useEffect(() => { + if (modal.current) { + modal.current.hide = function () { + props.onClose && props.onClose() + } + } + }, [props.onClose]) + useEffect(() => { if (modal.current) { if (props.visible) {