Skip to content

Conversation

@haradakunihiko
Copy link
Owner

Summary

  • Use root.unmount() before removing wrapper from DOM
  • This ensures React portals (e.g., Bootstrap modals) are properly cleaned up
  • Add dismiss function documentation to External Control section in README

Background

When using UI libraries that render via React portals (like Bootstrap Modal), simply removing the wrapper element from DOM doesn't clean up the portal-rendered elements. Calling root.unmount() ensures React properly cleans up all mounted components including portals.

Test plan

  • Tested locally with Bootstrap Modal
  • Verify modal backdrop and dialog are removed when dialog is closed

🤖 Generated with Claude Code

- Use root.unmount() before removing wrapper from DOM
- This ensures React portals (e.g., Bootstrap modals) are properly cleaned up
- Add dismiss function documentation to External Control section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@haradakunihiko haradakunihiko merged commit 8772d77 into master Dec 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants