Using a React 16 Portal to do something cool

React 16 is here, and one of the more interesting additions is ‘Portals’. Portals let you render a bit of React-controlled DOM outside of the parent component. The React docs explain it nicely, using the example of a modal. It works well for tooltips, too (here’s one I made earlier)….

Source: https://hackernoon.com/using-a-react-16-portal-to-do-something-cool-2a2d627b0202

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.