{"id":149072,"date":"2020-08-15T19:23:52","date_gmt":"2020-08-15T11:23:52","guid":{"rendered":"http:\/\/4563.org\/?p=149072"},"modified":"2020-08-15T19:23:52","modified_gmt":"2020-08-15T11:23:52","slug":"react-%e5%a4%a7%e4%bd%ac%e6%9c%89%e6%b2%a1%e6%9c%89%ef%bc%8c-ts-%e6%9c%89%e5%8a%9e%e6%b3%95%e5%9c%a8%e7%bc%96%e8%af%91%e9%98%b6%e6%ae%b5%e9%99%90%e5%88%b6-react-%e5%ad%90%e7%bb%84%e4%bb%b6%e7%9a%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=149072","title":{"rendered":"React \u5927\u4f6c\u6709\u6ca1\u6709\uff0c ts \u6709\u529e\u6cd5\u5728\u7f16\u8bd1\u9636\u6bb5\u9650\u5236 react \u5b50\u7ec4\u4ef6\u7684\u53c2\u6570\u7c7b\u578b\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  React \u5927\u4f6c\u6709\u6ca1\u6709\uff0c ts \u6709\u529e\u6cd5\u5728\u7f16\u8bd1\u9636\u6bb5\u9650\u5236 react \u5b50\u7ec4\u4ef6\u7684\u53c2\u6570\u7c7b\u578b\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lblblong <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6bd4\u5982\u6709\u4e00\u4e2a Form \u7ec4\u4ef6\uff0c\u5b83\u9700\u8981\u6240\u6709\u5b50\u7ec4\u4ef6\u90fd\u6709 name \u5b57\u6bb5<\/p>\n<pre><code>&lt;Form&gt;     &lt;Input name=\"username\"&gt;&lt;\/Input&gt;     &lt;Select name=\"sex\"&gt;&lt;\/Select&gt;          \/\/ \u8fd9\u91cc\u5199\u7684\u65f6\u5019\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u6ca1\u6709 name \u5b57\u6bb5     &lt;div&gt;&lt;\/div&gt; &lt;\/Form&gt; <\/code><\/pre>\n<p>\u8fd8\u6709\u5c31\u662f form \u53ef\u4ee5\u9650\u5236\u5b50\u7ec4\u4ef6\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u6bd4\u5982\uff1a<\/p>\n<pre><code>interface IUserSchema {     username: string     sex: 1 | 2 }  &lt;Form schema={IUserSchema}&gt;     &lt;Input name=\"username\"&gt;&lt;\/Input&gt;     &lt;Select name=\"sex\"&gt;&lt;\/Select&gt;          \/\/ \u8fd9\u91cc\u5199\u7684\u65f6\u5019\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u6ca1\u6709 age \u5b57\u6bb5     &lt;Input name=\"age\"&gt;&lt;\/Input&gt; &lt;\/Form&gt; <\/code><\/pre>\n<p>\u6ce8\u610f\uff0c\u4ee5\u4e0a\u90fd\u9700\u8981\u5728\u7f16\u8bd1\u9636\u6bb5\u5c31\u8fc7\u4e0d\u4e86<\/p>\n<pre><code>interface IProps {   children?: \/\/ \u8fd9\u91cc\u7684\u7c7b\u578b\u9700\u8981\u600e\u4e48\u5199\u624d\u80fd\u5b9e\u73b0\u4e0a\u9762\u7684\u9700\u6c42\u5462?  }  export const Form: FunctionComponent&lt;IProps&gt; = ({ children }) =&gt; {   return &lt;form&gt;{children}&lt;\/form&gt; } <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3095708\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sunjourney <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u80fd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3095709\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shunia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u6837\u53ef\u4ee5\u6ee1\u8db3\u5417\uff1f<\/p>\n<p>![]( https:\/\/tva1.sinaimg.cn\/large\/007S8ZIlly1gi369a0ffaj30pu0vswif.jpg)                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3095710\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : swirling <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u9700\u8981\u4e00\u4e2a\u597d\u4e00\u70b9\u7684 form \u5e93\u6765\u505a\u8fd9\u4ef6\u4e8b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3095711\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KuroNekoFan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u90a3\u4f60\u53ef\u80fd\u9700\u8981\u628a jsx \u7528\u4e00\u7ec4\u6570\u636e\u6765\u8868\u793a\uff0c\u518d\u628a\u8fd9\u7ec4\u6570\u636e map \u6210 jsx \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3095712\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lblblong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shunia \u6211\u6d4b\u8bd5\u6ca1\u6709\u7528\u6b38\uff0c\u4e0d\u77e5\u9053\u662f\u4e0d\u662f tsconfig \u914d\u7f6e\u7684\u95ee\u9898<br \/>https:\/\/img.vim-cn.com\/d5\/990a67b42d42bca2ad5fb80bf8a653cf734147.png                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>React \u5927\u4f6c\u6709\u6ca1\u6709\uff0c ts \u6709&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/149072"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149072"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/149072\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149072"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}