<?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: Sudhanshu Shekhar</title>
    <description>The latest articles on DEV Community by Sudhanshu Shekhar (@sid04).</description>
    <link>https://dev.to/sid04</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%2F2547265%2F424dd805-a388-4fd1-808f-2dc0cdff21c1.png</url>
      <title>DEV Community: Sudhanshu Shekhar</title>
      <link>https://dev.to/sid04</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sid04"/>
    <language>en</language>
    <item>
      <title>Ever wonder how Linux-based images can run on your Windows machine</title>
      <dc:creator>Sudhanshu Shekhar</dc:creator>
      <pubDate>Fri, 24 Jan 2025 04:04:40 +0000</pubDate>
      <link>https://dev.to/sid04/ever-wonder-how-linux-based-images-can-run-on-your-windows-machine-4480</link>
      <guid>https://dev.to/sid04/ever-wonder-how-linux-based-images-can-run-on-your-windows-machine-4480</guid>
      <description>&lt;p&gt;Ever wonder how Linux-based images can run on your Windows machine, even though the OS dependencies are Linux, and by container architecture, a Linux-based image should run on a Linux host to share the OS with similar images?&lt;/p&gt;

&lt;p&gt;To achieve this, Docker uses lightweight VMs like WSL 2 or LinuxKit, as the Windows kernel is incompatible with Linux-based containers. The VM is highly optimized (hence not a problem like the overhead we face while running traditional virtual machines directly).&lt;/p&gt;

&lt;p&gt;The VM bridges networking, file sharing, and resource management to integrate seamlessly with the Windows host. For Windows containers, Docker directly uses the Windows kernel without needing a VM. This setup ensures efficient performance and compatibility for both Linux and Windows-based containers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to enable two way binding in react</title>
      <dc:creator>Sudhanshu Shekhar</dc:creator>
      <pubDate>Mon, 09 Dec 2024 13:42:46 +0000</pubDate>
      <link>https://dev.to/sid04/how-to-enable-two-way-binding-in-react-3im3</link>
      <guid>https://dev.to/sid04/how-to-enable-two-way-binding-in-react-3im3</guid>
      <description>&lt;p&gt;React is a one-way binding library. However, if you want to send a function or data from a child component to a parent component, you can use the &lt;code&gt;useImperativeHandle&lt;/code&gt; hook. &lt;/p&gt;

&lt;p&gt;To do this, you first define a ref in the parent component and pass it to the child component, which should be wrapped in &lt;code&gt;forwardRef&lt;/code&gt; (although in React 19, we don't need it my bundler still have 18). &lt;/p&gt;

&lt;p&gt;You then pass that ref to the &lt;code&gt;useImperativeHandle&lt;/code&gt; hook, which takes three parameters: the first is the ref, the second is a callback function that returns all the values and functions you want to transfer from the child to the parent, and the third is a dependency array. If you want to send state data, include it in the dependency array so that it will return fresh values.&lt;/p&gt;

&lt;p&gt;Below is a demo component that logs a name from the parent, which is defined in the child component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ovd8e02ik1dvce28lo0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ovd8e02ik1dvce28lo0.png" alt="Image description" width="800" height="802"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
