{"id":819,"date":"2022-01-01T16:31:22","date_gmt":"2022-01-01T15:31:22","guid":{"rendered":"https:\/\/codeflarelimited.com\/blog\/?p=819"},"modified":"2022-02-10T02:54:08","modified_gmt":"2022-02-10T01:54:08","slug":"complete-sweet-alert-tutorial-with-react-js","status":"publish","type":"post","link":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/","title":{"rendered":"Complete Sweet Alert Tutorial With React JS"},"content":{"rendered":"\n<p>Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.<\/p>\n\n\n\n<p>Alerts are necessary and simple pointers that can even be created using Javascript:<\/p>\n\n\n\n<pre title=\"Alert.js\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">alert(\"hello world!\")<\/code><\/pre>\n\n\n\n<p>Sweet Alert can be integrated with most programming languages and libraries. But in this tutorial, we shall be implementing it in our React application.<\/p>\n\n\n\n<p>If you are new to Sweet Alert you can get started with it <a href=\"https:\/\/sweetalert.js.org\/guides\/#getting-started\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>And for the sake of this tutorial, we are going to be making use of a variant <a href=\"https:\/\/sweetalert2.github.io\" target=\"_blank\" rel=\"noreferrer noopener\">SweetAlert2<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Let&#8217;s get started.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-first-we-ll-create-a-very-simple-button-with-bootstrap\">1. First we&#8217;ll create a very simple button with bootstrap<\/h3>\n\n\n\n<p>Create a new React application and add the following dependencies:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">yarn add bootstrap\nyarn add sweetalert2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-next-we-ll-create-our-react-component-and-our-button\">2. Next, we&#8217;ll create our React Component and our button<\/h3>\n\n\n\n<pre title=\"Home.js\" class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">import React, { Component } from \"react\";\n\nclass Home extends Component {\n  render(){\n  return(\n  &lt;div&gt;\n  \n &lt;\/div&gt;\n )\n }\n}\n\nexport default Home;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-we-ll-add-our-bootstrap-button\">3. We&#8217;ll Add our Bootstrap button<\/h3>\n\n\n\n<pre title=\"Home.js\" class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">import React, { Component } from \"react\";\nimport \"bootstrap\/dist\/css\/bootstrap.min.css\";\n\nclass Home extends Component {\n  render(){\n  return(\n   &lt;div className=\"container d-flex justify-content-center\" style={{marginTop: 90}}&gt;\n   &lt;button onClick={this.showAlert} className=\"btn btn-primary btn-lg\"&gt;\n      Show Alert\n&lt;\/button&gt;\n     &lt;\/div&gt;\n )\n }\n}\n\nexport default Home;<\/code><\/pre>\n\n\n\n<p>Notice that in our button we have function <em><strong>showAlert<\/strong><\/em> which will be fired when we click on the button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"445\" height=\"192\" src=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-15.49.26.png\" alt=\"sweet alert with react js\" class=\"wp-image-821\" srcset=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-15.49.26.png 445w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-15.49.26-300x129.png 300w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><figcaption>Sweet Alert with React JS<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-finally-we-ll-implement-the-sweet-alert-logic-in-our-onclick-function\">4. Finally, we&#8217;ll implement the Sweet Alert Logic in our <em>onClick<\/em> function<\/h3>\n\n\n\n<pre title=\"Home.js\" class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">    showAlert = () =&gt; {\n        Swal.fire({\n            title: \"Success\",\n            text: \"Alert successful\",\n            icon: \"success\",\n            confirmButtonText: \"OK\",\n          });\n    }<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-full-code-logic-here\">Full code Logic here<\/h3>\n\n\n\n<pre title=\"Home.js\" class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">import React, { Component } from \"react\";\nimport Swal from \"sweetalert2\";\nimport \"bootstrap\/dist\/css\/bootstrap.min.css\";\n\n\nclass Home extends Component {\n\n    showAlert = () =&gt; {\n        Swal.fire({\n            title: \"Success\",\n            text: \"Alert successful\",\n            icon: \"success\",\n            confirmButtonText: \"OK\",\n          });\n    }\n\n    render(){\n        return(\n            &lt;div className=\"container d-flex justify-content-center\" style=.    {{marginTop: 90}}&gt;\n               &lt;button onClick={this.showAlert} className=\"btn btn-primary btn-lg\"&gt;Show Alert&lt;\/button&gt;\n            &lt;\/div&gt;\n        )\n    }\n}\n\nexport default Home<\/code><\/pre>\n\n\n\n<p>Here&#8217;s the result of our code:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"915\" height=\"654\" src=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-16.01.46.png\" alt=\"sweet alert with react js\" class=\"wp-image-822\" srcset=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-16.01.46.png 915w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-16.01.46-300x214.png 300w, https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/Screenshot-2022-01-01-at-16.01.46-768x549.png 768w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><figcaption>Sweet Alert With React JS<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-one-more-thing\">One more thing &#8230;<\/h3>\n\n\n\n<p>What if when we click on the button <em><strong>OK<\/strong><\/em>, we want to redirect our application to another page?<\/p>\n\n\n\n<p><a href=\"https:\/\/codeflarelimited.com\/blog\/working-with-react-router-in-react-js\/\" target=\"_blank\" rel=\"noreferrer noopener\">Learn about React Router here<\/a><\/p>\n\n\n\n<p>We&#8217;ll just modify our <em><strong>showAlert<\/strong><\/em> function as follows <\/p>\n\n\n\n<pre title=\"Home.js\" class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">\n    showAlert = () =&gt; {\n        Swal.fire({\n            title: \"Success\",\n            text: \"Alert successful\",\n            icon: \"success\",\n            confirmButtonText: \"OK\",\n          }).then(function () {\n              \/\/ Redirect the user\n              window.location.href = \"\/new-page\";\n            });\n    }\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>This is how to implement Sweet Alert in your React JS applications.<\/p>\n\n\n\n<p>Let me know what you think in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed<\/p>\n","protected":false},"author":1,"featured_media":825,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[98],"tags":[],"class_list":["post-819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-softare-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Complete Sweet Alert Tutorial With React JS<\/title>\n<meta name=\"description\" content=\"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Complete Sweet Alert Tutorial With React JS\" \/>\n<meta property=\"og:description\" content=\"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/codeflretech\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-01T15:31:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-10T01:54:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"753\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"codeflare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codeflaretech\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/\"},\"author\":{\"name\":\"codeflare\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\"},\"headline\":\"Complete Sweet Alert Tutorial With React JS\",\"datePublished\":\"2022-01-01T15:31:22+00:00\",\"dateModified\":\"2022-02-10T01:54:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/\"},\"wordCount\":238,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/alert2.jpeg\",\"articleSection\":[\"softare development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/\",\"name\":\"Complete Sweet Alert Tutorial With React JS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/alert2.jpeg\",\"datePublished\":\"2022-01-01T15:31:22+00:00\",\"dateModified\":\"2022-02-10T01:54:08+00:00\",\"description\":\"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#primaryimage\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/alert2.jpeg\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/alert2.jpeg\",\"width\":1500,\"height\":753,\"caption\":\"sweet alert in react js\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/complete-sweet-alert-tutorial-with-react-js\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"softare development\",\"item\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/softare-development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Complete Sweet Alert Tutorial With React JS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"name\":\"\",\"description\":\"Sustainable solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#organization\",\"name\":\"Codeflare Limited\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"contentUrl\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/codeflare.png\",\"width\":1040,\"height\":263,\"caption\":\"Codeflare Limited\"},\"image\":{\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e65653d49add95629f8c1053c5cd76a\",\"name\":\"codeflare\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g\",\"caption\":\"codeflare\"},\"description\":\"Latest tech news and coding tips.\",\"sameAs\":[\"https:\\\/\\\/codeflarelimited.com\\\/blog\",\"https:\\\/\\\/facebook.com\\\/codeflretech\",\"https:\\\/\\\/instagram.com\\\/codeflaretech\",\"https:\\\/\\\/x.com\\\/codeflaretech\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1\"],\"url\":\"https:\\\/\\\/codeflarelimited.com\\\/blog\\\/author\\\/watcher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Complete Sweet Alert Tutorial With React JS","description":"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.","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:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/","og_locale":"en_US","og_type":"article","og_title":"Complete Sweet Alert Tutorial With React JS","og_description":"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.","og_url":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/","article_author":"https:\/\/facebook.com\/codeflretech","article_published_time":"2022-01-01T15:31:22+00:00","article_modified_time":"2022-02-10T01:54:08+00:00","og_image":[{"width":1500,"height":753,"url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","type":"image\/jpeg"}],"author":"codeflare","twitter_card":"summary_large_image","twitter_creator":"@codeflaretech","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#article","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/"},"author":{"name":"codeflare","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a"},"headline":"Complete Sweet Alert Tutorial With React JS","datePublished":"2022-01-01T15:31:22+00:00","dateModified":"2022-02-10T01:54:08+00:00","mainEntityOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/"},"wordCount":238,"commentCount":0,"publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","articleSection":["softare development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/","url":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/","name":"Complete Sweet Alert Tutorial With React JS","isPartOf":{"@id":"https:\/\/codeflarelimited.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#primaryimage"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#primaryimage"},"thumbnailUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","datePublished":"2022-01-01T15:31:22+00:00","dateModified":"2022-02-10T01:54:08+00:00","description":"Sweet Alert helps your software application give fanciful and useful feedback to users after they must have performed some action.","breadcrumb":{"@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#primaryimage","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","width":1500,"height":753,"caption":"sweet alert in react js"},{"@type":"BreadcrumbList","@id":"https:\/\/codeflarelimited.com\/blog\/complete-sweet-alert-tutorial-with-react-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeflarelimited.com\/blog\/"},{"@type":"ListItem","position":2,"name":"softare development","item":"https:\/\/codeflarelimited.com\/blog\/softare-development\/"},{"@type":"ListItem","position":3,"name":"Complete Sweet Alert Tutorial With React JS"}]},{"@type":"WebSite","@id":"https:\/\/codeflarelimited.com\/blog\/#website","url":"https:\/\/codeflarelimited.com\/blog\/","name":"","description":"Sustainable solutions","publisher":{"@id":"https:\/\/codeflarelimited.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeflarelimited.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codeflarelimited.com\/blog\/#organization","name":"Codeflare Limited","url":"https:\/\/codeflarelimited.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","contentUrl":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2020\/11\/codeflare.png","width":1040,"height":263,"caption":"Codeflare Limited"},"image":{"@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/codeflarelimited.com\/blog\/#\/schema\/person\/7e65653d49add95629f8c1053c5cd76a","name":"codeflare","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/59cef917c86d965eea581d2747f51bd6382003a68bfce7c8a4dfec98b4cd838d?s=96&d=mm&r=g","caption":"codeflare"},"description":"Latest tech news and coding tips.","sameAs":["https:\/\/codeflarelimited.com\/blog","https:\/\/facebook.com\/codeflretech","https:\/\/instagram.com\/codeflaretech","https:\/\/x.com\/codeflaretech","https:\/\/www.youtube.com\/channel\/UCuBLtiYqsajHdqw0uyt7Ofw?sub_confirmation=1"],"url":"https:\/\/codeflarelimited.com\/blog\/author\/watcher\/"}]}},"jetpack_featured_media_url":"https:\/\/codeflarelimited.com\/blog\/wp-content\/uploads\/2022\/01\/alert2.jpeg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/comments?post=819"}],"version-history":[{"count":4,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":881,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/posts\/819\/revisions\/881"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media\/825"}],"wp:attachment":[{"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/media?parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/categories?post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeflarelimited.com\/blog\/wp-json\/wp\/v2\/tags?post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}