文件名称:conuse:上下文+使用
文件大小:100KB
文件格式:ZIP
更新时间:2024-05-22 03:27:07
react hook state-management reactjs context
混淆 与Context共享Hook English | 开始使用 import React , { useState } from 'react' ; import createConuse from 'conuse' ; // :keycap_1: Create a custom hook const useCounter = ( ) => { const [ count , setCount ] = useState ( 0 ) ; const increment = ( ) => setCount ( prevCount => prevCount + 1 ) ; return { count , increment } ; } ; // :keycap_2: Wrap your hook with the createConuse factory const { ConuseProvider ,
【文件预览】:
conuse-master
----.gitignore(91B)
----tsconfig.json(563B)
----README.md(3KB)
----.github()
--------workflows()
----rollup.config.js(1KB)
----test()
--------conuse.test.tsx(6KB)
--------.eslintrc(378B)
----README-zh.md(3KB)
----examples()
--------counter()
--------toggle()
--------package.json(282B)
--------index.js(712B)
--------index.html(321B)
--------yarn.lock(167KB)
----.eslintrc(611B)
----package.json(2KB)
----src()
--------index.tsx(3KB)
----jest.config.js(140B)
----.eslintignore(14B)
----.npmignore(113B)
----babel.config.js(368B)
----yarn.lock(165KB)