with-hooks-support:用于解锁类组件内部的React Hooks的高阶组件

时间:2021-05-14 05:26:54
【文件属性】:
文件名称:with-hooks-support:用于解锁类组件内部的React Hooks的高阶组件
文件大小:26KB
文件格式:ZIP
更新时间:2021-05-14 05:26:54
react hooks reactjs react-components higher-order-component withHooksSupport 用于向类组件添加挂钩支持的高阶组件。 查看“ 。 class FancyInput extends React . Component { render ( ) { // `useFormInput` returns an object with `value` and `onChange` attributes. const inputProps = useFormInput ( ) ; return < input { ... inputProps } / > ; } } export default withHooksSupport ( FancyInput ) ; 用法 npm install with-hooks-support 然后导入 import withHooksSupport from 'with-
【文件预览】:
with-hooks-support-master
----.gitignore(18B)
----.babelrc(147B)
----package.json(1KB)
----src()
--------index.js(655B)
----.travis.yml(300B)
----rollup.config.js(399B)
----README.md(2KB)
----.npmignore(0B)
----yarn.lock(62KB)

网友评论