lib-react-hooks:通用React钩子库:atom_symbol_selector:
React Hooks库通用React钩子库安装yarn安装: $ yarn add lib-react-hooks或者,如果您愿意,则选择npm : $ npm install --save lib-react-hooks用法只需导入要在React组件中使用的任何钩子即可。使用useAsync示例: import React from 'react' ; import { useAsync } from 'lib-react-hooks' ; const Component = ( ) => { const request = useAsync ( async ( ) => { const response = await fetch ( 'https://api.example.com/users/123' ) ; return response . json ( ) ; } ) ; return ( < div> { request . complete ? ( < p> { `Name:
lib-react-hooks-master.zip
预估大小:24个文件
lib-react-hooks-master
文件夹
netlify.toml
54B
.eslintrc
35B
doczrc.js
236B
rollup.config.js
935B
.github
文件夹
ISSUE_TEMPLATE.md
569B
PULL_REQUEST_TEMPLATE.md
1KB
CONTRIBUTING.md
2KB
commitlint.config.js
72B
252.42KB
文件大小:
评论区