segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

Convert Portal to functional component, properly remove DOM element on unmount #1549

Closed brandongregoryscott closed 1 year ago

brandongregoryscott commented 1 year ago

Overview Resolves #1365

This PR implements proper cleanup for the container div that we create for the Portal component, refactors it to a functional component, and adds some test coverage for it. Note: This should maintain SSR compatibility (only attempts to run createPortal once the useEffect has been run on the client)

Screenshots (if applicable)

Documentation

netlify[bot] commented 1 year ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit f3dab67c3e4327aff0e0ec43ee7f0a55f175b53c
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/637bada08b33090008f797ef
Deploy Preview https://deploy-preview-1549--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.