<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Subhasish Sarkar</title>
    <description>The latest articles on DEV Community by Subhasish Sarkar (@subhasishsarkar).</description>
    <link>https://dev.to/subhasishsarkar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F464930%2Fe130e9b5-3f4d-4163-958a-fce924897ef2.png</url>
      <title>DEV Community: Subhasish Sarkar</title>
      <link>https://dev.to/subhasishsarkar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/subhasishsarkar"/>
    <language>en</language>
    <item>
      <title>window.confirm component in react</title>
      <dc:creator>Subhasish Sarkar</dc:creator>
      <pubDate>Sun, 13 Aug 2023 09:55:46 +0000</pubDate>
      <link>https://dev.to/subhasishsarkar/windowconfirm-component-in-react-1f8m</link>
      <guid>https://dev.to/subhasishsarkar/windowconfirm-component-in-react-1f8m</guid>
      <description>&lt;p&gt;In web app we frequently use window.confirm() which return a promise and when resolved we do something base on the user input. I tried doing the same thing with context api. The context provider redender the children and a confirmation modal componet. The context gives an useConfirm() method which returns an async function lets say confirm(). Now calling this confirm() method with an await, the confirmation modal gets rendered.&lt;/p&gt;

&lt;p&gt;I have created a npm library of this implementation and also added some customisation feature.&lt;/p&gt;

&lt;p&gt;Check this link for full details: &lt;a href="https://www.npmjs.com/package/react-confirm-window"&gt;https://www.npmjs.com/package/react-confirm-window&lt;/a&gt; &lt;/p&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
