Skip to content

Commit 12e0d8b

Browse files
committed
improved readme
1 parent 69b8f01 commit 12e0d8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ It takes advantage of the `resize` event of the `<object>` HTML element.
1212

1313
It requires just React.js and ReactDOM.
1414

15-
Install it with
15+
Install it with:
1616

1717
```
1818
npm install react-resize-aware --save
1919
```
2020

2121
# Usage
2222

23+
> **note**: `ResizeAware` needs a position different from `initial` to work!
24+
> Make sure to set it to `relative`, `absolute` or `fixed` trough `style` or CSS
25+
2326
```jsx
2427
import React, { Component } from 'react'
2528
import { findDOMNode } from 'react-dom'
@@ -28,7 +31,7 @@ import ResizeAware from 'react-resize-aware'
2831
export default class FooBar extends Component {
2932
render() {
3033
return (
31-
<ResizeWare ref='container'>
34+
<ResizeWare ref='container' style={{position: 'relative'}}>
3235
Hello, World!
3336
</ResizeAware>
3437
)

0 commit comments

Comments
 (0)