{"id":470405,"date":"2025-08-12T09:00:07","date_gmt":"2025-08-12T09:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=470405"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=470405","title":{"rendered":"<span>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u043c\u043e\u0449\u043d\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0444\u043e\u0440\u043c \u0434\u043b\u044f SolidJS \u0441 Zod<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043f\u0440\u043e \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>solidjs-hook-form<\/code>,\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u0440\u043c \u0432 SolidJS.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u043f\u0443\u0442\u043e\u0432, boilerplate&#8230; \u041a\u0430\u043f\u0435\u0446, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u0435\u0439, \u0430 \u0441 \u043a\u0443\u0447\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412\u043e\u0442 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043b\u0438\u0431\u0443.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u044f? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c SolidJS, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435 \u0431\u044b\u043b\u043e. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e-\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0433\u043e, \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u043c\u0430\u0433\u0438\u0438, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u043b\u0438\u0434\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0435\u0440\u0442\u0430. <code>solidjs-hook-form<\/code> \u2014 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0437\u043e\u043b\u043e\u0442\u043e\u0439 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f.<\/p>\n<p><strong>\u0427\u0435\u043c \u043e\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430?<\/strong><\/p>\n<p>\u041d\u0443, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <strong>\u0431\u044b\u0441\u0442\u0440\u0430\u044f<\/strong>. \u041f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0435 \u0447\u0430\u0441\u044b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>solid-js\/store<\/code> \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043e\u043a. \u0422\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, <strong>\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438<\/strong>. \u0412\u0441\u0451 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u0443\u043a\u0430 <code>useForm<\/code>. \u041a\u0438\u043d\u0443\u043b \u0442\u0443\u0434\u0430 \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u2014 \u0438 \u0432\u0443\u0430\u043b\u044f, \u0443 \u0442\u0435\u0431\u044f \u0435\u0441\u0442\u044c \u0432\u0441\u0451, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u043e\u0440\u043c\u043e\u0439.<\/p>\n<p>\u0410 \u0441\u0445\u0435\u043c\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Zod<\/strong>. \u042d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u043e\u043c\u0431\u0430. \u041f\u0438\u0448\u0435\u0448\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u2014 \u0438 \u0432\u0441\u0451. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u043e\u043b\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438. Zod \u0440\u0443\u043b\u0438\u0442.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442?<\/strong><\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0442 \u043a\u0440\u0430\u0441\u043e\u0442\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0445\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Zod import { z } from 'zod';  const registerSchema = z.object({   email: z.string().email({ message: \"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 email \u0430\u0434\u0440\u0435\u0441\" }),   password: z.string().min(8, { message: \"\u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c 8 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\" }),   confirmPassword: z.string() }).superRefine(({ password, confirmPassword }, ctx) =&amp;gt; {   \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439   if (password !== confirmPassword) {     ctx.addIssue({       code: \"custom\",       message: \"\u041f\u0430\u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442\",       path: [\"confirmPassword\"]     });   } });  \/\/ \u041f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 import { useForm } from 'solidjs-hook-form';  export default function RegisterForm() {   const { form, formErrors, handleChange, validate } = useForm(registerSchema);    const handleSubmit = (e) =&gt; {     e.preventDefault();     \/\/ \u0412\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0444\u043e\u0440\u043c\u0443     if (validate()) {       \/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u043e\u043a \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435       console.log(\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b:\", form);       \/\/ ...\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440     } else {       console.log(\"\u0424\u043e\u0440\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0438.\");     }   };    return (     &lt;form onSubmit={handleSubmit}&gt;       &lt;div&gt;         &lt;label for=\"email\"&gt;Email&lt;\/label&gt;         &lt;input          type=\"email\"          {\/*name \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0432 zod \u0441\u0445\u0435\u043c\u0435*\/}         name=\"email\"          id=\"email\"         value={form.email}          onInput={handleChange}         &gt;         {\/* \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c *\/}         {formErrors.email &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.email}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;div&gt;         &lt;label for=\"password\"&gt;\u041f\u0430\u0440\u043e\u043b\u044c&lt;\/label&gt;         &lt;input           id=\"password\"           name=\"password\"           type=\"password\"           value={form.password}           onInput={handleChange}         \/&gt;         {formErrors.password &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.password}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;div&gt;         &lt;label for=\"confirmPassword\"&gt;\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c&lt;\/label&gt;         &lt;input           id=\"confirmPassword\"           name=\"confirmPassword\"           type=\"password\"           value={form.confirmPassword}           onInput={handleChange}         \/&gt;         {formErrors.confirmPassword &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.confirmPassword}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;button type=\"submit\"&gt;\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f&lt;\/button&gt;     &lt;\/form&gt;   ); } <\/code><\/pre>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435, \u043a\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e? <code>useForm<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0448\u0442\u0443\u043a\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><code>form<\/code> \u2014 \u044d\u0442\u043e \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p><code>formErrors<\/code> \u2014 \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p><code>handleChange<\/code> \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0451 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p><code>validate()<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u0438\u043b\u0438 <code>false<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e Zod?<\/strong><\/p>\n<p>\u041d\u0443, Zod \u2014 \u044d\u0442\u043e \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u043e\u043d \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0444\u043e\u0440\u043c\u044b \u0432 DOM. <code>solidjs-hook-form<\/code> \u043a\u0430\u043a \u0440\u0430\u0437 \u0431\u0435\u0440\u0451\u0442 \u044d\u0442\u0443 \u0440\u0443\u0442\u0438\u043d\u0443 \u043d\u0430 \u0441\u0435\u0431\u044f. \u041f\u0438\u0448\u0435\u0448\u044c \u0441\u0445\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c \u0445\u0443\u043a \u2014 \u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 <code>createStore, createSignal<\/code> \u0438\u043b\u0438 \u0440\u0443\u0447\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p><strong>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c?<\/strong><\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 npm \u043f\u0430\u043a\u0435\u0442:<\/p>\n<p><code>npm i\u00a0solidjs-hook-form<\/code><\/p>\n<p>\u0412 \u043f\u0430\u043a\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0438\u0434\u0443\u0442 \u0438 \u0442\u0438\u043f\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u0441 Typescript \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e. \u0422\u0438\u043f \u0444\u043e\u0440\u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 zod \u0441\u0445\u0435\u043c\u044b, \u0441\u0430\u043c\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u0434\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0434<\/p>\n<p><strong>\u0413\u0434\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0449\u0451 \u043f\u0440\u0438\u043c\u0435\u0440\u044b?<\/strong><\/p>\n<p>\u041d\u0430 <a href=\"https:\/\/www.npmjs.com\/package\/solidjs-hook-form?activeTab=readme\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 npm<\/a> \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><strong>\u0412 \u043e\u0431\u0449\u0435\u043c<\/strong><\/p>\n<p><code>solidjs-hook-form<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043b\u043e\u043d React Hook Form. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 SolidJS. \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0435, \u0430 \u043d\u0435 \u043d\u0430 \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u0444\u043e\u0440\u043c\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 SolidJS \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u043b\u044f\u043d\u044c\u0442\u0435. \u041c\u043e\u0436\u0435\u0442, \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e!<\/p>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/biyrololo\/solidjs-hook-form\" rel=\"noopener noreferrer nofollow\">GitHub<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/solidjs-hook-form\" rel=\"noopener noreferrer nofollow\">NPM<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/zod.dev\/\" rel=\"noopener noreferrer nofollow\">Zod<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/936196\/\"> https:\/\/habr.com\/ru\/articles\/936196\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043f\u0440\u043e \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>solidjs-hook-form<\/code>,\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u0440\u043c \u0432 SolidJS.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u043f\u0443\u0442\u043e\u0432, boilerplate&#8230; \u041a\u0430\u043f\u0435\u0446, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u0435\u0439, \u0430 \u0441 \u043a\u0443\u0447\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412\u043e\u0442 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043b\u0438\u0431\u0443.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u044f? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c SolidJS, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435 \u0431\u044b\u043b\u043e. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0447\u0435\u0433\u043e-\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0433\u043e, \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u043c\u0430\u0433\u0438\u0438, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u043b\u0438\u0434\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0435\u0440\u0442\u0430. <code>solidjs-hook-form<\/code> \u2014 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0437\u043e\u043b\u043e\u0442\u043e\u0439 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f.<\/p>\n<p><strong>\u0427\u0435\u043c \u043e\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430?<\/strong><\/p>\n<p>\u041d\u0443, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <strong>\u0431\u044b\u0441\u0442\u0440\u0430\u044f<\/strong>. \u041f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0435 \u0447\u0430\u0441\u044b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>solid-js\/store<\/code> \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043e\u043a. \u0422\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, <strong>\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438<\/strong>. \u0412\u0441\u0451 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u0443\u043a\u0430 <code>useForm<\/code>. \u041a\u0438\u043d\u0443\u043b \u0442\u0443\u0434\u0430 \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u2014 \u0438 \u0432\u0443\u0430\u043b\u044f, \u0443 \u0442\u0435\u0431\u044f \u0435\u0441\u0442\u044c \u0432\u0441\u0451, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u043e\u0440\u043c\u043e\u0439.<\/p>\n<p>\u0410 \u0441\u0445\u0435\u043c\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Zod<\/strong>. \u042d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u043e\u043c\u0431\u0430. \u041f\u0438\u0448\u0435\u0448\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u2014 \u0438 \u0432\u0441\u0451. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u043e\u043b\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438. Zod \u0440\u0443\u043b\u0438\u0442.<\/p>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442?<\/strong><\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0442 \u043a\u0440\u0430\u0441\u043e\u0442\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0445\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Zod import { z } from 'zod';  const registerSchema = z.object({   email: z.string().email({ message: \"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 email \u0430\u0434\u0440\u0435\u0441\" }),   password: z.string().min(8, { message: \"\u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c 8 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\" }),   confirmPassword: z.string() }).superRefine(({ password, confirmPassword }, ctx) =&amp;gt; {   \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439   if (password !== confirmPassword) {     ctx.addIssue({       code: \"custom\",       message: \"\u041f\u0430\u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442\",       path: [\"confirmPassword\"]     });   } });  \/\/ \u041f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 import { useForm } from 'solidjs-hook-form';  export default function RegisterForm() {   const { form, formErrors, handleChange, validate } = useForm(registerSchema);    const handleSubmit = (e) =&gt; {     e.preventDefault();     \/\/ \u0412\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0444\u043e\u0440\u043c\u0443     if (validate()) {       \/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u043e\u043a \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435       console.log(\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b:\", form);       \/\/ ...\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440     } else {       console.log(\"\u0424\u043e\u0440\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0438.\");     }   };    return (     &lt;form onSubmit={handleSubmit}&gt;       &lt;div&gt;         &lt;label for=\"email\"&gt;Email&lt;\/label&gt;         &lt;input          type=\"email\"          {\/*name \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0432 zod \u0441\u0445\u0435\u043c\u0435*\/}         name=\"email\"          id=\"email\"         value={form.email}          onInput={handleChange}         &gt;         {\/* \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c *\/}         {formErrors.email &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.email}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;div&gt;         &lt;label for=\"password\"&gt;\u041f\u0430\u0440\u043e\u043b\u044c&lt;\/label&gt;         &lt;input           id=\"password\"           name=\"password\"           type=\"password\"           value={form.password}           onInput={handleChange}         \/&gt;         {formErrors.password &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.password}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;div&gt;         &lt;label for=\"confirmPassword\"&gt;\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c&lt;\/label&gt;         &lt;input           id=\"confirmPassword\"           name=\"confirmPassword\"           type=\"password\"           value={form.confirmPassword}           onInput={handleChange}         \/&gt;         {formErrors.confirmPassword &amp;&amp; &lt;p style={{ color: 'red' }}&gt;{formErrors.confirmPassword}&lt;\/p&gt;}       &lt;\/div&gt;        &lt;button type=\"submit\"&gt;\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f&lt;\/button&gt;     &lt;\/form&gt;   ); } <\/code><\/pre>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435, \u043a\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e? <code>useForm<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0448\u0442\u0443\u043a\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><code>form<\/code> \u2014 \u044d\u0442\u043e \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p><code>formErrors<\/code> \u2014 \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p><code>handleChange<\/code> \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0451 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p><code>validate()<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u0438\u043b\u0438 <code>false<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e Zod?<\/strong><\/p>\n<p>\u041d\u0443, Zod \u2014 \u044d\u0442\u043e \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u043e\u043d \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0444\u043e\u0440\u043c\u044b \u0432 DOM. <code>solidjs-hook-form<\/code> \u043a\u0430\u043a \u0440\u0430\u0437 \u0431\u0435\u0440\u0451\u0442 \u044d\u0442\u0443 \u0440\u0443\u0442\u0438\u043d\u0443 \u043d\u0430 \u0441\u0435\u0431\u044f. \u041f\u0438\u0448\u0435\u0448\u044c \u0441\u0445\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c \u0445\u0443\u043a \u2014 \u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 <code>createStore, createSignal<\/code> \u0438\u043b\u0438 \u0440\u0443\u0447\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p><strong>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c?<\/strong><\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 npm \u043f\u0430\u043a\u0435\u0442:<\/p>\n<p><code>npm i\u00a0solidjs-hook-form<\/code><\/p>\n<p>\u0412 \u043f\u0430\u043a\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0438\u0434\u0443\u0442 \u0438 \u0442\u0438\u043f\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u0441 Typescript \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e. \u0422\u0438\u043f \u0444\u043e\u0440\u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 zod \u0441\u0445\u0435\u043c\u044b, \u0441\u0430\u043c\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u0434\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0434<\/p>\n<p><strong>\u0413\u0434\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0449\u0451 \u043f\u0440\u0438\u043c\u0435\u0440\u044b?<\/strong><\/p>\n<p>\u041d\u0430 <a href=\"https:\/\/www.npmjs.com\/package\/solidjs-hook-form?activeTab=readme\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 npm<\/a> \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><strong>\u0412 \u043e\u0431\u0449\u0435\u043c<\/strong><\/p>\n<p><code>solidjs-hook-form<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043b\u043e\u043d React Hook Form. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 SolidJS. \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0435, \u0430 \u043d\u0435 \u043d\u0430 \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u0444\u043e\u0440\u043c\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 SolidJS \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u043b\u044f\u043d\u044c\u0442\u0435. \u041c\u043e\u0436\u0435\u0442, \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e!<\/p>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/biyrololo\/solidjs-hook-form\" rel=\"noopener noreferrer nofollow\">GitHub<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/solidjs-hook-form\" rel=\"noopener noreferrer nofollow\">NPM<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/zod.dev\/\" rel=\"noopener noreferrer nofollow\">Zod<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/936196\/\"> https:\/\/habr.com\/ru\/articles\/936196\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-470405","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=470405"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470405\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}