1.1.0 • Published 3 years ago

element-helpers v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Helper for your React Element :star2::star2:

Installation

npm i element-helpers

Usage

import { useGetDimensions } from "element-helpers";

function App() {
  const [refNode, { width, height }] = useGetDimensions();

  console.log("height : ", height); // 100
  console.log("width : ", width); // 300

  return (
    <div
      ref={refNode}
      style={{ width: 300, height: 100, backgroundColor: "red" }}
    />
  );
}

export default App;

Props

NameRequiredInformation
refNodetrueYou can change the name
widthfalse
heightfalse
bottomfalse
leftfalse
rightfalse
topfalse
xfalse
yfalse
1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago