diff --git a/packages/rax-modal/CHANGELOG.md b/packages/rax-modal/CHANGELOG.md index f1322adf..c0a6ea38 100644 --- a/packages/rax-modal/CHANGELOG.md +++ b/packages/rax-modal/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.6.6 + +- Check the existence before setting style of mask node + ## 1.6.5 - Keep wechat native code in older dir diff --git a/packages/rax-modal/package.json b/packages/rax-modal/package.json index 97d76788..1f807b09 100644 --- a/packages/rax-modal/package.json +++ b/packages/rax-modal/package.json @@ -1,6 +1,6 @@ { "name": "rax-modal", - "version": "1.6.5", + "version": "1.6.6", "description": "rax-modal", "license": "BSD-3-Clause", "main": "lib/index.js", diff --git a/packages/rax-modal/src/index.tsx b/packages/rax-modal/src/index.tsx index d6b6c771..d6bfcbea 100644 --- a/packages/rax-modal/src/index.tsx +++ b/packages/rax-modal/src/index.tsx @@ -120,12 +120,16 @@ function Modal(props: ModalProps) { } setVisibleState(true); if (animation) { - maskRef.current.style.opacity = '0'; + if (maskRef.current) { + maskRef.current.style.opacity = '0'; + } animate(true, () => { onShow && onShow(); }); } else { - maskRef.current.style.opacity = '1'; + if (maskRef.current) { + maskRef.current.style.opacity = '1'; + } onShow && onShow(); } }