topeka:React中惯用的“双向”绑定

时间:2021-05-16 23:27:22
【文件属性】:
文件名称:topeka:React中惯用的“双向”绑定
文件大小:206KB
文件格式:ZIP
更新时间:2021-05-16 23:27:22
TypeScript 托佩卡 topeka利用React上下文,为复杂或嵌套的值创建低摩擦输入绑定。 用法 import { Binding , useBinding } from 'topeka' ; const BoundInput = ( { name , ... props } ) => { const [ value , onChange ] = useBinding ( name ) ; return < input { ... props } name = { name } value = { value } onChange = { onChange } / > ; } ; function App ( ) { const [ value , setValue ] = useState ( { } ) ; return ( < div> < Binding
【文件预览】:
topeka-master
----.travis.yml(121B)
----.eslintrc.yml(183B)
----.babelrc.js(216B)
----package.json(3KB)
----test()
--------.eslintrc(30B)
--------update.test.js(1KB)
--------setup.js(267B)
--------bindings.test.js(5KB)
----src()
--------updateIn.ts(1KB)
--------Binding.tsx(3KB)
--------useBinding.tsx(1KB)
--------BindingContext.tsx(6KB)
--------useValue.tsx(274B)
--------index.ts(307B)
----tsconfig.json(116B)
----.gitignore(1KB)
----CHANGELOG.md(4KB)
----README.md(919B)
----yarn.lock(539KB)
----.gitattributes(378B)

网友评论