Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed What's New in React 16!
You have completed What's New in React 16!
Preview
React 16 introduces a new way of rendering into the DOM. You can render children into a DOM element that exists outside of your App's main DOM tree, with a new feature called “portals.”
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
outside of your apps main DOM tree
with a new feature called Portals.
0:00
For example, in your index.html template,
you'll usually have a div with the id
0:02
root, which is where your entire app is
rendered into the DOM via ReactDOM.render.
0:08
Well, to create a portal, you add a second
element that's a sibling of your root div.
0:14
So I'll create a div
with the id my-portal.
0:20
Then you can render specific parts
of your component tree inside
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up