@@ -11,13 +11,13 @@ In addition, it doesn't directly alters the DOM, everything is handled by React.
1111## Installation
1212
1313```
14- yarn add react-resize-aware@3.0.0-beta.1
14+ yarn add react-resize-aware@3.0.0-beta.3
1515```
1616
1717or with npm:
1818
1919```
20- npm install --save react-resize-aware@3.0.0-beta.1
20+ npm install --save react-resize-aware@3.0.0-beta.3
2121```
2222
2323## Usage
@@ -30,11 +30,11 @@ import React from 'react';
3030import useResizeAware from ' react-resize-aware' ;
3131
3232const App = () => {
33- const [ResizeListener , sizes ] = useResizeAware ();
33+ const [resizeListener , sizes ] = useResizeAware ();
3434
3535 return (
3636 < div style= {{ position: ' relative' }}>
37- < ResizeListener / >
37+ {resizeListener}
3838 Your content here. (div sizes are {sizes .width } x {sizes .height })
3939 < / div>
4040 );
@@ -47,11 +47,11 @@ const App = () => {
4747
4848The Hook returns an array with two elements inside:
4949
50- ### ` [ResizeListener , ...] ` (first element)
50+ ### ` [resizeListener , ...] ` (first element)
5151
52- This is an invisible component that must be placed as direct-child of the HTMLElement you want to listen the resize events of.
52+ This is an invisible React node that must be placed as direct-child of the HTMLElement you want to listen the resize events of.
5353
54- The component is not going to interfer with your layouts, I promise.
54+ The node is not going to interfer with your layouts, I promise.
5555
5656### ` [..., sizes] ` (second element)
5757
@@ -66,11 +66,11 @@ const customReporter = element => ({
6666 clientWidth: target != null ? target .clientWidth : null ,
6767});
6868
69- const [ResizeListener , sizes ] = useResizeAware (customReporter);
69+ const [resizeListener , sizes ] = useResizeAware (customReporter);
7070
7171return (
7272 < div style= {{ position: ' relative' }}>
73- < ResizeListener / >
73+ {resizeListener}
7474 Your content here. (div clientWidth is {sizes .clientWidth })
7575 < / div>
7676);
0 commit comments