<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sunil's Tech Blog]]></title><description><![CDATA[Practical engineering articles on React, Next.js, frontend performance, and open-source tooling by Sunil S V, creator of Native Form.]]></description><link>https://sunilsv26.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ae1d47f249a27cc5acebbcf/81b4824b-8dfd-493e-832b-8589b2981246.jpg</url><title>Sunil&apos;s Tech Blog</title><link>https://sunilsv26.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 04 Nov 2026 01:29:05 GMT</lastBuildDate><atom:link href="https://sunilsv26.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why Are We Still Registering Inputs in React? Introducing Native Form]]></title><description><![CDATA[Traditional form libraries in the React ecosystem (such as React Hook Form and Formik) are undeniably popular, but they often force developers to treat…]]></description><link>https://sunilsv26.hashnode.dev/why-are-we-still-registering-inputs-in-react-introducing-native-form</link><guid isPermaLink="true">https://sunilsv26.hashnode.dev/why-are-we-still-registering-inputs-in-react-introducing-native-form</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[React]]></category><category><![CDATA[HTML]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[forms]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[npm]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Full Stack Development]]></category><dc:creator><![CDATA[Sunil Reddy]]></dc:creator><pubDate>Wed, 28 Oct 2026 11:05:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae1d47f249a27cc5acebbcf/2b855ece-deb7-4490-9a1b-03704de892b4.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Traditional form libraries in the React ecosystem (such as React Hook Form and Formik) are undeniably popular, but they often force developers to treat standard HTML forms as legacy.</p>
<p>To use them, you typically have to:</p>
<ul>
<li>Pass manual refs or spread registration handlers onto every single input: <code>{...register("email")}</code></li>
<li>Wrap custom component inputs in heavy <code>&lt;Controller /&gt;</code> components</li>
<li>Manage complex context providers just to keep multi-step wizard values from vanishing when components unmount</li>
</ul>
<p>I wondered: <strong>What if we treated standard HTML forms as the single source of truth again, without losing type safety or React ergonomics?</strong></p>
<p>That is why I built <a href="https://github.com/sunilsv26/native-form"><strong>Native Form</strong></a>.</p>
<hr />
<h2>What is Native Form?</h2>
<p>Native Form is a zero-registration, DOM-first form runtime and validation engine for modern web apps.</p>
<ul>
<li><strong>GitHub</strong>: <a href="https://github.com/sunilsv26/native-form">github.com/sunilsv26/native-form</a></li>
<li><strong>npm</strong>: <code>npm i @native-form/react</code></li>
</ul>
<p>Instead of manually registering each input in JavaScript, Native Form leverages browser standards: it automatically discovers inputs directly from the DOM using standard HTML <code>name</code> attributes via a background <code>MutationObserver</code>.</p>
<hr />
<h2>Key Highlights</h2>
<h3>1. Zero Input Registration</h3>
<p>Write clean, standard HTML inputs. No <code>{...register()}</code> spreads, no ref forwarding gymnastics:</p>
<pre><code class="language-tsx">&lt;form ref={formRef} noValidate&gt;
  &lt;input name="email" type="email" /&gt;
  &lt;input name="age" type="number" /&gt;
&lt;/form&gt;
</code></pre>
<h3>2. Microscopic Schema Adapters (&lt; 500 Bytes)</h3>
<p>Whether you use <strong>Zod</strong>, <strong>Valibot</strong>, or <strong>Yup</strong>, Native Form provides plug-and-play resolvers that add less than 500 bytes to your production bundle. The core runtime itself has <strong>zero third-party dependencies</strong>.</p>
<h3>3. Built-in Multi-Step Wizard Memory</h3>
<p>With <code>preserveUnmountedValues: true</code> and the <code>useWizard</code> hook, field values are automatically preserved in runtime memory even when wizard step components unmount from the DOM.</p>
<h3>4. Cross-Platform Runtime</h3>
<p>The foundation (<code>@native-form/core</code>) is completely framework-agnostic. You can use the exact same runtime in Vanilla JavaScript, Vue 3, Svelte, or Angular, while <code>@native-form/react</code> provides React 18 &amp; 19 hooks.</p>
<hr />
<h2>Quick Example (React + Zod)</h2>
<p>Here is how clean a form looks with Native Form:</p>
<pre><code class="language-tsx">import { useForm } from "@native-form/react";
import { zodResolver } from "@native-form/zod";
import { z } from "zod";

const schema = z.object({
  email: z.string().email("Enter a valid email address"),
  age: z.number().min(18, "Must be at least 18"),
});

export function SignupForm() {
  const { formRef, formState } = useForm({
    schema: zodResolver(schema),
    serializationMode: "typed", // Automatically coerces type="number" and range sliders to JavaScript numbers
    onSubmit: (values) =&gt; {
      console.log("Validated submission:", values);
    },
  });

  return (
    &lt;form ref={formRef} noValidate&gt;
      &lt;label&gt;Email&lt;/label&gt;
      &lt;input name="email" type="email" placeholder="jane@example.com" /&gt;
      {formState.errors.email &amp;&amp; (
        &lt;span className="error"&gt;{formState.errors.email}&lt;/span&gt;
      )}

      &lt;label&gt;Age&lt;/label&gt;
      &lt;input name="age" type="number" placeholder="25" /&gt;
      {formState.errors.age &amp;&amp; (
        &lt;span className="error"&gt;{formState.errors.age}&lt;/span&gt;
      )}

      &lt;button type="submit" disabled={formState.submitting}&gt;
        {formState.submitting ? "Submitting..." : "Sign Up"}
      &lt;/button&gt;
    &lt;/form&gt;
  );
}
</code></pre>
<hr />
<h2>What’s New in v0.1.2?</h2>
<p>We recently released <strong>v0.1.2</strong>, which includes:</p>
<ul>
<li><strong>Range Slider Coercion</strong>: <code>&lt;input type="range"&gt;</code> automatically coerces to numbers for Zod <code>z.number()</code> validation.</li>
<li><strong>Immediate Discrete Control Re-Validation</strong>: Checkboxes and radio buttons clear errors immediately upon user selection without requiring blur events.</li>
<li><strong>Design System Isolation</strong>: Configurable <code>renderDomErrors</code> (defaulting to <code>false</code> in React) so custom UI frameworks like Material UI or Tailwind don't suffer from injected DOM conflicts.</li>
</ul>
<hr />
<h2>Try It Out &amp; Share Your Thoughts</h2>
<p>Native Form is open source and ready for testing:</p>
<ul>
<li><p><strong>Repository</strong>: <a href="https://github.com/sunilsv26/native-form">https://github.com/sunilsv26/native-form</a></p>
</li>
<li><p><strong>Install</strong>:</p>
<pre><code class="language-bash">npm i @native-form/react
</code></pre>
</li>
</ul>
<p>If you try it out, please drop a comment or open an issue on GitHub. I’d love to hear your feedback on the architecture, edge cases, or features you’d like to see next!</p>
]]></content:encoded></item></channel></rss>