CodePen Examples<\/a> – A search of React Portals<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"Say we need to render a child element into a React application. Easy right? That child is mounted to the nearest DOM element and rendered inside of it as a result. render() { return ( <div> \/\/ Child to render inside of the div <\/div> ); } But! What if we want to render that […]<\/p>\n","protected":false},"author":251966,"featured_media":280615,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"Using React Portals to Render Children Outside the DOM Hierarchy","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[4],"tags":[559,557],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/12\/weird-swirl.png?fit=4000%2C2000&ssl=1","jetpack-related-posts":[{"id":275161,"url":"https:\/\/css-tricks.com\/working-with-refs-in-react\/","url_meta":{"origin":280606,"position":0},"title":"Working with refs in React","date":"August 16, 2018","format":false,"excerpt":"Refs make it possible to access DOM nodes directly within React. This comes in handy in situations where, just as one example, you want to change the child of a component. Let\u2019s say you want to change the value of an element, but without using props or re-rendering the whole\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/08\/react-ref-imessage.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":273438,"url":"https:\/\/css-tricks.com\/render-children-in-react-using-fragment-or-array-components\/","url_meta":{"origin":280606,"position":1},"title":"Render Children in React Using Fragment or Array Components","date":"July 17, 2018","format":false,"excerpt":"What comes to your mind when React 16 comes up? Context? Error Boundary? Those are on point. React 16 came with those goodies and much more, but In this post, we'll be looking at the rendering power it also introduced \u2014 namely, the ability to render children using Fragments and\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/04\/react.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":270816,"url":"https:\/\/css-tricks.com\/how-react-reconciliation-works\/","url_meta":{"origin":280606,"position":2},"title":"How React Reconciliation Works","date":"May 17, 2018","format":false,"excerpt":"React is fast! Some of that speed comes from updating only the parts of the DOM that need it. Less for you to worry about and a speed gain to boot. As long as you understand the workings of setState(), you should be good to go. However, it\u2019s also important\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/05\/website-states.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":254985,"url":"https:\/\/css-tricks.com\/react-forms-using-refs\/","url_meta":{"origin":280606,"position":3},"title":"React Forms: Using Refs","date":"May 23, 2017","format":false,"excerpt":"React provides two standard ways to grab values from elements. The first method is to implement what are called controlled components (see my blog post on the topic) and the second is to use React's ref property. Controlled components are heavy duty. The defining characteristic of a controlled component is\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":281073,"url":"https:\/\/css-tricks.com\/intro-to-react-hooks\/","url_meta":{"origin":280606,"position":4},"title":"Intro to React Hooks","date":"January 18, 2019","format":false,"excerpt":"Hooks make it possible to organize logic in components, making them tiny and reusable without writing a class. In a sense, they\u2019re React\u2019s way of leaning into functions because, before them, we\u2019d have to write them in a component and, while components have proven to be powerful and functional in\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/01\/coat-rack-hooks.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":285727,"url":"https:\/\/css-tricks.com\/the-circle-of-a-react-lifecycle\/","url_meta":{"origin":280606,"position":5},"title":"The Circle of a React Lifecycle","date":"April 23, 2019","format":false,"excerpt":"A React component goes through different phases as it lives in an application, though it might not be evident that anything is happening behind the scenes. Those phases are: mounting updating unmounting error handling There are methods in each of these phases that make it possible to perform specific actions\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/03\/circle-of-react-lifecycle.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"featured_media_src_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/12\/weird-swirl.png?fit=1024%2C512&ssl=1","_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/280606"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/251966"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=280606"}],"version-history":[{"count":3,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/280606\/revisions"}],"predecessor-version":[{"id":280619,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/280606\/revisions\/280619"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/280615"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=280606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=280606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=280606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}