Comments (3)
Which UI library do you use? You need to call modal.remove()
from the callback like afterHideAnimation
of the Modal component from the UI lib. For example, the built-in muiDialogV5 helper calls modal.remove when onExited
:
export const muiDialogV5 = (
modal: NiceModalHandler,
): { open: boolean; onClose: () => void; TransitionProps: { onExited: () => void } } => {
return {
open: modal.visible,
onClose: () => modal.hide(),
TransitionProps: {
onExited: () => {
modal.resolveHide();
!modal.keepMounted && modal.remove();
},
},
};
};
See the code here:
nice-modal-react/src/index.tsx
Line 637 in e9c2583
from nice-modal-react.
This is the library NextUI
I tried to use onAnimationEnd
for the modal.remove()
call but it was still not removing it from the component tree afterwards.
from nice-modal-react.
@dml0031 can you create a codesandbox sample?
from nice-modal-react.
Related Issues (20)
- Nice Modal integration with Material UI HOT 3
- Problem with getting data from react-router-dom useParams hook HOT 7
- Can the .show() method be smarter about its return type? HOT 3
- NiceModalProps should let objects with id HOT 5
- How to lazy load a mui dialog in nextjs when it's open? HOT 6
- Source map references file not in npm package HOT 3
- I want to destroy all the popups that are being displayed when the backend interface 401, how do I do that? HOT 3
- MUI Drawer help method HOT 1
- bug: 当路由发生变化时,弹窗不会自动销毁 HOT 6
- Globally check if any modal is visible HOT 1
- Unnecessary re-render when showing multiple modals..? HOT 4
- Hot module reloading / fast refresh support? HOT 2
- Disable body scroll lock and react portal HOT 1
- Is this library able to be used with Next.js 13 and App router? HOT 5
- Type regression in 1.2.9 HOT 13
- remove() Function without Modal ID just like hide() HOT 2
- Refactor modalHandler into a React Hook HOT 2
- [Request] Improve typing of modal props HOT 2
- Antd "visible" prop is deprecated, use "open" instead HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nice-modal-react.