【文件属性】:
文件名称:rex-state:将钩子转换为React组件之间的共享状态
文件大小:710KB
文件格式:ZIP
更新时间:2021-05-02 13:48:17
react redux state-management state hacktoberfest
雷克斯状态
将钩子转换为React组件之间的共享状态
公关人员欢迎 :thumbs_up: :sparkles:
:package: 安装
:information: 用法
:bookmark_tabs: 文献资料
:school:示例
CodeSandbox上带有React.js的简单计数器
在博览会上使用React Native的黑暗模式。 example/目录中的项目
:sparkles: 为什么是雷克斯状态?
要求
Rex State是纯粹基于React Hooks构建的,因此它需要React> 16.8才能工作。
安装
yarn add rex-state
# or
npm i rex-state
用法
考虑以下挂钩,可让您在亮和暗模式之间切换主题
const useThemeMode = ( initialTheme = 'light' ) => {
const [ theme , setTheme ] = useState ( initialTheme ) ;
const toggl
【文件预览】:
rex-state-master
----.gitattributes(72B)
----.github()
--------FUNDING.yml(37B)
--------workflows()
----yarn.lock(426KB)
----src()
--------index.tsx(860B)
--------__tests__()
----babel.config.js(77B)
----CONTRIBUTING.md(8KB)
----example()
--------metro.config.js(1KB)
--------yarn.lock(730KB)
--------webpack.config.js(806B)
--------src()
--------babel.config.js(438B)
--------.storybook()
--------app.json(585B)
--------index.js(319B)
--------package.json(1KB)
----tsconfig.json(689B)
----LICENSE(1KB)
----assets()
--------logo.png(123KB)
----jest.config.js(6KB)
----README.md(7KB)
----.npmrc(16B)
----.editorconfig(283B)
----.gitignore(655B)
----.eslintignore(53B)
----package.json(3KB)