[过时]用于 React Hooks API 的 Ponyfill(支持 RN)

时间:2021-06-08 14:46:14
【文件属性】:
文件名称:[过时]用于 React Hooks API 的 Ponyfill(支持 RN)
文件大小:57KB
文件格式:ZIP
更新时间:2021-06-08 14:46:14
Awesome React Hooks react-with-hooks 用于 React Hooks API 的 Polyfill 和 ponyfill。 适用于 React Native! :warning: master 分支上的代码仍然是 WIP。 安装 $ npm i react-with-hooks --save 用法 你可以使用 react-with-hooks 作为 polyfill; 在这种情况下,当您稍后过渡到原生 React Hooks 时,您只需删除 import 'react-with-hooks/polyfill' 语句: import 'react-with-hooks/polyfill'; // 在你的应用程序入口导入 polyfill import React, { useState, useEffect } from 'react'; const Counter = () => { const [ count, setCount ] = useState(0); useEffect(() => { document.title = "count is " + count; }) retur
【文件预览】:
react-with-hooks-master
----.travis.yml(118B)
----polyfill.js(44B)
----package.json(1KB)
----tests()
--------ReactHooksWithReactDOM.test.js(3KB)
--------ReactHooksWithNoopRenderer.test.js(58KB)
----LICENSE(1KB)
----src()
--------polyfill.js(2KB)
--------index.js(978B)
--------withHooks.js(23KB)
--------ReactCurrentDispatcher.js(391B)
--------scheduleCallback.js(159B)
--------objectIs.js(536B)
--------ReactHookEffectTags.js(432B)
--------__mocks__()
--------ReactHooks.js(2KB)
--------ReactSideEffectTags.js(1KB)
----index.d.ts(1KB)
----.gitignore(56B)
----vendors()
--------react-noop-renderer()
----README.md(3KB)
----scripts()
--------alertFlag.sh(202B)
--------jest()
----babel.config.js(142B)

网友评论