react-innertext:返回React JSX对象的innerText

时间:2021-01-31 02:47:10
【文件属性】:
文件名称:react-innertext:返回React JSX对象的innerText
文件大小:23KB
文件格式:ZIP
更新时间:2021-01-31 02:47:10
react javascript npm babel webpack ReactinnerText 返回React JSX对象的innerText,类似于DOM元素的innerText属性。 安装 npm install react-innertext或 yarn add react-innertext 利用 客户端渲染(ES6) import innerText from 'react-innertext' ; innerText ( < div> Hello < strong> world < / strong > ! I am < span xss=removed> years old! < / div > ) // 'Hello world! I am 3 years old!' 服务器端渲染(CommonJS) const innerText = require ( 'react-innertext' ) ; innerText ( < div> Hello < strong> world < / strong > ! I am < span children = { 3
【文件预览】:
react-innertext-master
----.gitignore(51B)
----package.json(1KB)
----src()
--------index.ts(1KB)
----.travis.yml(928B)
----LICENSE(1KB)
----tsconfig.json(450B)
----README.md(2KB)
----tests()
--------index.test.tsx(2KB)
----.npmignore(152B)
----yarn.lock(40KB)

网友评论