with-context:React官方上下文API的装饰器

时间:2024-06-07 11:10:15
【文件属性】:

文件名称:with-context:React官方上下文API的装饰器

文件大小:61KB

文件格式:ZIP

更新时间:2024-06-07 11:10:15

reactjs JavaScript

with-context 这个包是干嘛的 React v16.3.0 版本提供了官方正式版本的 ,看到这个消息我是非常期待的,仿佛看到摆脱了Redux的自己在夕阳下奔跑的样子,但还没等我高兴几下,但是官网的demo就给我破了一盆凉水。 官方的demo是这么写的: const ThemeContext = React.createContext('light'); class ThemeProvider extends React.Component { state = {theme: 'light'}; render() { return ( {this.props.children}


【文件预览】:
with-context-master
----.gitignore(292B)
----.babelrc(95B)
----package.json(845B)
----package-lock.json(264KB)
----src()
--------index.js(994B)
----build()
--------webpack.config.js(484B)
----LICENSE(1KB)
----README.md(4KB)
----lib()
--------index.js(3KB)
----.npmignore(40B)

网友评论