r/reactjs • • Sep 26 '17

React v16.0 - React Blog

https://facebook.github.io/react/blog/2017/09/26/react-v16.0.html
219 Upvotes

37 comments sorted by

View all comments

12

u/Ombudsperson Sep 26 '17

I can already see viable use cases for Portals, overall exciting stuff.

3

u/dryadofelysium Sep 26 '17

As an Angular user that uses Angular Material for dialogs (which used Portals for some time now for this purpose), I am wondering how you React guys have dealt with these problems before then?

6

u/acemarke Sep 26 '17

Portals have been used for a while in React, by using components that either call ReactDOM.render() to create a new component tree, or using the ReactDOM.unstable_renderSubtreeIntoContainer() API. The react-portal library is an example.

On which note, I gave examples of using portals to render modals and context menus in my post Practical Redux, Part 10: Managing Modals and Context Menus.