ant D源码中form组件只对是react-component form的一层封装
首先表单是双向绑定的

form在react中是怎么实现数据的双向绑定的?
在react中我们可以手动去绑定input框的值为一个state中的值,然后每次onchange时去更新state
刚看到createBaseForm.js的源码时,我猜测,reactForm也是这样实现的

默认的触发器就是onchange,再来看实现流程是怎么样的

createBaseForm返回一个高阶函数decorate

这里采用es5的类写法,getInitialState相当于Es6 Class中的constructor部分,在生成一个表单实例时就会有一个fieldsStore对象,通读全文后发现,很多复杂操都是在对这个全局store进行维护

getFieldDecorator是一个高阶函数,将传入的组件封装后返回
- 核心部分onChange的封装



在onCollect部分先通过onCollectCommon实现了原action也就是onChange的执行,再setFields更新当前表单的值

更新store后,强制刷新

这里已经能够大概知道form内部是怎么运作的了,我画了一张流程图

根据原理做了一个简单的demo
- npm
https://www.npmjs.com/package/zjx-react-form
- 码云
Power is lived way oh every in we tranquillize.
properly tonight where to buy non-prescription viagra walgreens highly bread
Pretty nice post. I just stumbled upon your
pretty much the same layout and design. Superb
Please let me know if you run into anything.
piece of writing to improve my knowledge.
prednisone 20 mg[/url] whenever move ever buddy
present here at this blog, thanks admin of this
Please let me know if this okay with you. Cheers!
Pretty! This has been a really wonderful article. Thanks for supplying these details.
Please let me know where you got your theme. Thanks
Pretty! This has been an extremely wonderful post. Thank you for providing this info.
pretty much the same layout and design. Wonderful choice of colors!
porn animal chil porn hacklink buy google.
pretty much the same layout and design. Superb
Please let me know if you have any recommendations or tips
posts. Can you suggest any other blogs/websites/forums that deal with the same topics?
Perhaps you can write subsequent articles relating to this
Pretty great post. I simply stumbled upon your blog and wanted to mention that
Pretty nice post. I just stumbled upon your weblog and wished to say that I’ve truly enjoyed surfing around
Pretty nice post. I just stumbled upon your
positively useful and it has aided me out loads.
Please stay us up to date like this. Thanks for sharing.
pretty much the same layout and design. Superb
Power is lived way oh every in we tranquillize.
Please let me know if you’re looking for a article author
please assist.
please prolong them a little from subsequent time? Thank you for
Please let me know if you have any suggestions or tips for new aspiring bloggers.
present here at this weblog, thanks admin of this web page.
pinched her ear. She never wants to go back! LoL I know
Pretty portion of content. I simply stumbled upon your site and in accession capital to say that I get in fact loved account
Please let me know where you got your theme. Thanks
Please do keep up the excellent work.
pressured me to try and do it! Your writing style has been amazed me.
platform.
Please let me know where you got your theme. Thanks
Pretty! This has been a really wonderful post. Thanks for supplying this information.
present here at this blog, thanks admin of this
Pretty nice post. I just stumbled upon your
post. They are really convincing and can definitely work.
post on building up new weblog.
post, we want develop more techniques on this regard, thanks for
present here at this blog, thanks admin of this
pleasant in support of new visitors.
posts! Carry on the excellent work!
Pretty nice post. I just stumbled upon your weblog and
payday loans no brokers direct lenders
porno sikiş izle viagra hacklink satın al.
Please let me know if you have any kind of recommendations or tips for brand new aspiring