We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
项目名称: 基于 react hooks 实现的极简全局状态管理库
项目地址: https://github.com/masx200/react-simple-global-state-store-hook
类别: javascript
项目简介 (100 字以内):
项目描述: 基于 react hooks 实现的极简全局状态管理库,可以跨组件共享全局状态 仅仅使用 44 行代码写成的极简 react 全局状态管理库!
推荐理由: 跟 redux 对比,极为简洁!抛弃 redux! redux主要由store,action,reducer等等组成,过于庞大负杂,繁琐
react-simple-global-state-store-hook只管理状态仓库,修改全局状态的方法返回给组件内部调用,就跟使用useState一样简单!
import useGlobalstate from "react-simple-global-state-store-hook"; function Htest() { const { number: [number, setnumber] } = useGlobalstate({ number: 78546 }); //全局状态 number 生成 ,初始值为 78546 return ( <div> <p> number: {number} </p> <button onClick={() => { setnumber(number * 3); /*修改全局状态number,其他使用了全局状态number的组件也会刷新数据*/ }} > 修改number </button> </div> ); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
项目名称:
基于 react hooks 实现的极简全局状态管理库
项目地址:
https://github.com/masx200/react-simple-global-state-store-hook
类别:
javascript
项目简介 (100 字以内):
项目描述:
基于 react hooks 实现的极简全局状态管理库,可以跨组件共享全局状态
仅仅使用 44 行代码写成的极简 react 全局状态管理库!
推荐理由:
跟 redux 对比,极为简洁!抛弃 redux!
redux主要由store,action,reducer等等组成,过于庞大负杂,繁琐
react-simple-global-state-store-hook只管理状态仓库,修改全局状态的方法返回给组件内部调用,就跟使用useState一样简单!
The text was updated successfully, but these errors were encountered: