diff options
author | Francesco <firefelix@gmail.com> | 2015-06-19 13:44:46 +0200 |
---|---|---|
committer | Francesco <firefelix@gmail.com> | 2015-06-19 13:44:46 +0200 |
commit | f2d1a4388f8282523b4d07e49e41e4a230733c61 (patch) | |
tree | d17ddeb60381b49ea8c18628b8bd9bf70b8557ea | |
parent | b0ab36d96c51db8836d503946444c79692c9f8e6 (diff) | |
download | react-autosize-textarea-f2d1a4388f8282523b4d07e49e41e4a230733c61.zip react-autosize-textarea-f2d1a4388f8282523b4d07e49e41e4a230733c61.tar.gz react-autosize-textarea-f2d1a4388f8282523b4d07e49e41e4a230733c61.tar.bz2 |
Update README.md
-rw-r--r-- | README.md | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -7,11 +7,11 @@ A light replacement for built-in textarea component which automaticaly adjusts i This module is based on the very popular autosize script written by Jack Moore. Check its website [here](http://www.jacklmoore.com/autosize/) for more documentation. ``` -var Textarea = require('react-autosize-textarea'); +var TextareaAutosize = require('react-autosize-textarea'); React.renderComponent( <div> - <Textarea></Textarea> + <TextareaAutosize {...textareaProps} onResize={() => {}} /> </div>, document.body); ``` @@ -21,6 +21,14 @@ React.renderComponent( npm install --save react-autosize-textarea ``` +###API +You can pass any props you're allowed to use with default React textarea (valueLink too). + +You can also pass the callback **onResize** which will be triggered at any resize: +``` +onResize: React.PropTypes.func +``` + ###Browser Compatibility | Chrome | Firefox | IE | Safari | Android | | ------------- | ------------- | ----- | ------ | ------- | |