{"id":3760,"date":"2021-07-14T15:34:12","date_gmt":"2021-07-14T15:34:12","guid":{"rendered":"https:\/\/ionicframework.com\/blog\/?p=3760"},"modified":"2021-07-15T01:51:19","modified_gmt":"2021-07-15T01:51:19","slug":"introducing-the-new-overlay-hooks-for-ionic-react","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react","title":{"rendered":"Introducing the New Overlay Hooks for Ionic React"},"content":{"rendered":"<p>Hello Friends! We know everyone is excited about the new features in Ionic Framework 6.0 beta, but that doesn&#8217;t mean we&#8217;re done with V5! In Ionic React 5.6, we packaged up a new set of hooks for controlling our overlay components that we think you might like. What is an overlay you ask? It\u2019s the term we give components that display over your current content, such as alerts, modals, toasts, etc.<\/p>\n<p>In this post, I\u2019m going to go over how to use the new hooks to display these components in your apps. But first, let&#8217;s do a quick recap on how overlays worked before, and some of the challenges that you might encounter with them.<\/p>\n<p><!--more--><\/p>\n<h2>Overlay Components<\/h2>\n<p>Each of the overlays has a React component that is exported from <code>@ionic\/react<\/code>, such as <code>IonAlert<\/code> and <code>IonLoading<\/code>.  These components take a prop called <code>isOpen<\/code>, which determines if the overlay should be displayed or not:<\/p>\n<pre><code class=\"language-ts\">&lt;IonAlert\n  isOpen={showAlert}\n\/&gt;\n<\/code><\/pre>\n<p>These components are great and they aren\u2019t going away. The new hooks don&#8217;t deprecate them in any way. However, there&#8217;s some ceremony you have to observe to use them.<\/p>\n<p>First, managing the state that handles the <code>isOpen<\/code> prop could be a challenge. If the state was contained in the component that the overlay was in, then it was no problem (like a local state variable from <code>useState<\/code>). However, if the action to display the overlays was in a different part of the app, then you needed to use some state management technique or library to pass the <code>isOpen<\/code> prop along.<\/p>\n<p>Second, each of the Overlay components required you to provide an <code>onDidDismiss<\/code> callback that would flip the <code>isOpen<\/code> prop back to false in case the overlay dismissed itself somehow. Not overriding it would cause <code>isOpen<\/code> to stay true, and if your app tried to show the overlay again, then you would be setting true to true, and Ionic wouldn\u2019t detect the change and, thus, wouldn&#8217;t display it again.<\/p>\n<pre><code class=\"language-ts\">&lt;IonAlert\n  isOpen={showAlert}\n  message=&#039;Hello there friend&#039;\n  onDidDismiss={() =&gt; setShowAlert(false)}\n\/&gt;\n<\/code><\/pre>\n<p>A third challenge was that it was difficult to display an overlay from outside of your component; for instance, if you wanted to display an alert when an API request failed. Ionic Angular had controller instances you could import to use in services to display overlays. In React, this was more difficult to do.<\/p>\n<p>The new overlay hooks in Ionic React 5.6 help with all these scenarios.<\/p>\n<h2>Overlay Hooks<\/h2>\n<p>The goal of the overlay hooks was to reduce this process and to make the usage of the overlays feel more natural for those writing functional React components.<\/p>\n<p>To get started with the hooks, you import the hook for the overlay you want to use from <code>@ionic\/react<\/code> like so:<\/p>\n<pre><code class=\"language-ts\">import { useIonAlert } from &#039;@ionic\/react&#039;\n<\/code><\/pre>\n<p>Next, in your functional component, you call the hook to get back the show and hide methods, which get returned in an array similar to how <code>useState<\/code> returns its members. We choose the array method of destructuring so naming the methods is easier:<\/p>\n<pre><code class=\"language-ts\">const [showAlert, hideAlert] = useIonAlert();\n<\/code><\/pre>\n<blockquote><p>\n  Most overlays dismiss themselves when the user is done interacting with them, so you won\u2019t need the hide method for most scenarios.\n<\/p><\/blockquote>\n<p>Then to display the overlay, you call the show method:<\/p>\n<pre><code class=\"language-ts\">showAlert(&#039;Hello!&#039;);\n<\/code><\/pre>\n<p><a href=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay.png\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"348\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay.png\" alt=\"\" class=\"aligncenter size-full wp-image-3764 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay.png 826w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay-300x126.png 300w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay-768x324.png 768w\" data-sizes=\"auto, (max-width: 826px) 100vw, 826px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 826px; --smush-placeholder-aspect-ratio: 826\/348;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"348\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay.png\" alt=\"\" class=\"aligncenter size-full wp-image-3764\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay.png 826w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay-300x126.png 300w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/alert-overlay-768x324.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/noscript><\/a><\/p>\n<p>The alert will dismiss itself after the user clicks the &#8220;Ok&#8221; button. You don\u2019t need to worry about doing any additional work when the overlays go away.<\/p>\n<p>Most of the overlay hooks have options that you can pass to them. The more common options can be passed in as additional parameters. For instance, the toast overlay&#8217;s show method also takes the time to display the toast as its second parameter:<\/p>\n<pre><code class=\"language-ts\">showToast(&#039;Hello from a toast!&#039;,  3000);\n<\/code><\/pre>\n<p>This will display the toast for three seconds, and then the toast will dismiss itself.<\/p>\n<p>More options can be sent by passing in an object instead of the separate parameters:<\/p>\n<pre><code class=\"language-ts\">showToast({\n  buttons: [{ text: &#039;hide&#039;, handler: () =&gt; hideToast() }],\n  message: &#039;Hello, click hide to dismiss&#039;,\n  onDidDismiss: () =&gt; console.log(&#039;dismissed&#039;)              \n})\n<\/code><\/pre>\n<p>React hooks can be used in other hooks as well. Because of this, it&#8217;s possible to display an overlay from within other hooks, such as one responsible for fetching some data. Here is a sample custom hook to fetch a customer that displays a toast when the request fails:<\/p>\n<pre><code class=\"language-ts\">const useCustomer = (customerId: number) =&gt; {\n  const [customer, setCustomer] = useState&lt;Customer&gt;();\n  const [showToast] = useIonToast();\n  useEffect(() =&gt; {\n    fetchCustomer();\n    async function fetchCustomer() {\n      try {\n        const response = fetch(`myapi.com\/customers\/${customerId}`);\n        const data = await (await response).json();\n        setCustomer(data);\n      } catch {\n        showToast({\n          message: &#039;Oops, unable to get customer&#039;,\n          color: &#039;warning&#039;,\n          buttons: [{ icon: close }],\n        });\n      }\n    }\n  }, [customerId, showToast]);\n  return customer;\n};\n<\/code><\/pre>\n<h2>More Info<\/h2>\n<p>To learn more about the new hooks, visit our <a href=\"https:\/\/ionicframework.com\/docs\/react\/overlays\">guide on using overlays in Ionic React<\/a>, and check out the docs for each of the overlay components for usage examples:<\/p>\n<ul>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/action-sheet\">Action Sheet<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/modal#usage\">Alert<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/loading\">Loading<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/modal\">Modal<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/picker\">Picker<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/popover\">Popover<\/a><\/li>\n<li><a href=\"https:\/\/ionicframework.com\/docs\/api\/toast\">Toast<\/a><\/li>\n<\/ul>\n<p>Let us know in the comments down below if you have any feedback, and until next time, happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends! We know everyone is excited about the new features in Ionic Framework 6.0 beta, but that doesn&#8217;t mean we&#8217;re done with V5! In Ionic React 5.6, we packaged up a new set of hooks for controlling our overlay components that we think you might like. What is an overlay you ask? It\u2019s the [&hellip;]<\/p>\n","protected":false},"author":66,"featured_media":3762,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"0","publish_post_category":"28","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"510779","discourse_permalink":"https:\/\/forum.ionicframework.com\/t\/introducing-the-new-overlay-hooks-for-ionic-react\/212492","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[121,124],"tags":[136,149],"class_list":["post-3760","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering","category-tutorials","tag-react","tag-react-hooks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introducing the New Overlay Hooks for Ionic React - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introducing the New Overlay Hooks for Ionic React\" \/>\n<meta property=\"og:description\" content=\"Hello Friends! We know everyone is excited about the new features in Ionic Framework 6.0 beta, but that doesn&#8217;t mean we&#8217;re done with V5! In Ionic React 5.6, we packaged up a new set of hooks for controlling our overlay components that we think you might like. What is an overlay you ask? It\u2019s the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-14T15:34:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-15T01:51:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"880\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ely Lucas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@elylucas\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ely Lucas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\"},\"author\":{\"name\":\"Ely Lucas\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b\"},\"headline\":\"Introducing the New Overlay Hooks for Ionic React\",\"datePublished\":\"2021-07-14T15:34:12+00:00\",\"dateModified\":\"2021-07-15T01:51:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\"},\"wordCount\":728,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png\",\"keywords\":[\"react\",\"react hooks\"],\"articleSection\":[\"Engineering\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\",\"url\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\",\"name\":\"Introducing the New Overlay Hooks for Ionic React - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png\",\"datePublished\":\"2021-07-14T15:34:12+00:00\",\"dateModified\":\"2021-07-15T01:51:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png\",\"width\":1600,\"height\":880},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introducing the New Overlay Hooks for Ionic React\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b\",\"name\":\"Ely Lucas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g\",\"caption\":\"Ely Lucas\"},\"sameAs\":[\"https:\/\/x.com\/elylucas\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/ely\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introducing the New Overlay Hooks for Ionic React - Ionic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react","og_locale":"en_US","og_type":"article","og_title":"Introducing the New Overlay Hooks for Ionic React","og_description":"Hello Friends! We know everyone is excited about the new features in Ionic Framework 6.0 beta, but that doesn&#8217;t mean we&#8217;re done with V5! In Ionic React 5.6, we packaged up a new set of hooks for controlling our overlay components that we think you might like. What is an overlay you ask? It\u2019s the [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react","og_site_name":"Ionic Blog","article_published_time":"2021-07-14T15:34:12+00:00","article_modified_time":"2021-07-15T01:51:19+00:00","og_image":[{"width":1600,"height":880,"url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","type":"image\/png"}],"author":"Ely Lucas","twitter_card":"summary_large_image","twitter_creator":"@elylucas","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Ely Lucas","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react"},"author":{"name":"Ely Lucas","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b"},"headline":"Introducing the New Overlay Hooks for Ionic React","datePublished":"2021-07-14T15:34:12+00:00","dateModified":"2021-07-15T01:51:19+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react"},"wordCount":728,"commentCount":0,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"image":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","keywords":["react","react hooks"],"articleSection":["Engineering","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react","url":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react","name":"Introducing the New Overlay Hooks for Ionic React - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage"},"image":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","datePublished":"2021-07-14T15:34:12+00:00","dateModified":"2021-07-15T01:51:19+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#primaryimage","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","width":1600,"height":880},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/introducing-the-new-overlay-hooks-for-ionic-react#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Introducing the New Overlay Hooks for Ionic React"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/d4a019b9a30f6c3db51b24803ab2be9b","name":"Ely Lucas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/224137763c00c380285e911184f2139f2f4e2f15ecc2fcd9528feebc6d2ddab6?s=96&d=mm&r=g","caption":"Ely Lucas"},"sameAs":["https:\/\/x.com\/elylucas"],"url":"https:\/\/ionic.io\/blog\/author\/ely"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2021\/07\/react-overlay-hooks-feature-image.png","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/3760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=3760"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/3760\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media\/3762"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=3760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=3760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=3760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}