Skip to content

Commit daea3c0

Browse files
author
Federico Zivolo
committed
readme improvements
1 parent e2f94c9 commit daea3c0

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@
22

33
A simple React.js component you can use to make any piece of UI aware of its size.
44

5-
Each time the component changes its size (it can be due to a window resize, a CSS change, a JS action, etc...)
6-
a `resize` event will be fired on the component itself.
5+
Each time the component' size changes, your component will be notified by one of
6+
the methods described below.
7+
The size change can be detected by a window resize, a CSS media query,
8+
a CSS pseudo selector, a JavaScript action or really, anything.
79

8-
You can then listen to such event to perform any kind of operation.
10+
**This component doesn't rely on intervals, loops, DOM manipulation detection
11+
or any other weird stuff.
12+
It takes advantage of the `resize` event of the `<object>` HTML element.**
913

10-
This component doesn't rely on intervals, loops or any other weird stuff.
11-
It takes advantage of the `resize` event of the `<object>` HTML element.
14+
You don't have to care about anything, it will always work as you expect in any
15+
possible scenario.
16+
Also, it's just 2.6KB (or 1.2KB gzipped)! (no dependencies!)
1217

1318
Install it with:
1419

1520
```
16-
npm install react-resize-aware --save
21+
yarn add react-resize-aware
22+
# or
23+
npm install --save react-resize-aware
1724
```
1825

1926
# Usage

0 commit comments

Comments
 (0)