You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,11 @@ It is especially useful when you create components with dimensions that change o
9
9
time and you want to explicitely pass the container dimensions to the children. For example, SVG
10
10
visualization needs to be updated in order to fit into container.
11
11
12
+
It uses [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) and passes values for all `top`, `right`, `bottom`, `left`, `width`, `height` CSs attributes down the tree.
13
+
12
14
## Usage
13
15
14
-
* Wrap your existing components. Children component will recieve `width` and`height` as props.
16
+
* Wrap your existing components. Children component will recieve `top`, `right`, `bottom`, `left`, `width`,`height` as props.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "react-container-dimensions",
3
-
"version": "1.2.0",
3
+
"version": "1.3.0",
4
4
"description": "Wrapper component that detects element resize and passes new dimensions down the tree. Based on [element-resize-detector](https://github.com/wnr/element-resize-detector)",
0 commit comments