让你的 React 组件知道它们的宽度和高度!

时间:2021-06-08 16:44:19
【文件属性】:
文件名称:让你的 React 组件知道它们的宽度和高度!
文件大小:139KB
文件格式:ZIP
更新时间:2021-06-08 16:44:19
Reporter 让你的 React 组件知道它们的宽度和/或高度! 速度极快。 :face_with_tongue: 响应式组件! 易于使用。 广泛的浏览器支持。 支持任何组件类型,即无状态/类。 非常小的捆绑尺寸。 通过渲染道具模式使用它(支持子级或渲染道具): import { SizeMe } from 'react-sizeme' function MyApp() { return {({ 尺寸 }) => 我的宽度是 {size.width}px } 或者,通过更高阶的组件: import { withSize } from 'react-sizeme' function MyComponent({ size }) { return
【文件预览】:
react-sizeme-master
----.travis.yml(239B)
----rollup-min.config.js(270B)
----.nvmrc(3B)
----.babelrc(217B)
----rollup.config.js(837B)
----package.json(4KB)
----tools()
--------.eslintrc(85B)
--------utils.js(212B)
--------scripts()
----.github()
--------FUNDING.yml(646B)
----assets()
--------logo.png(8KB)
----wallaby.js(509B)
----LICENSE(1KB)
----src()
--------index.js(148B)
--------__tests__()
--------with-size.js(9KB)
--------component.js(1KB)
--------resize-detector.js(387B)
----.gitignore(121B)
----react-sizeme.d.ts(1KB)
----CHANGELOG.md(158B)
----README.md(12KB)
----yarn.lock(285KB)
----.eslintignore(69B)
----.editorconfig(174B)

网友评论