diff options
author | Francesco <firefelix@gmail.com> | 2016-09-14 15:15:27 +0300 |
---|---|---|
committer | Francesco <firefelix@gmail.com> | 2016-09-14 15:15:27 +0300 |
commit | 692aaad0484c453430039bdc4c0e71ebe1a0ffa5 (patch) | |
tree | a8fa57df229b4a2dbb5c8c32f25e4b7ca9f73f64 /src | |
parent | 03e7ccc30b29cde4668b3956fbdc8016fe21d1d6 (diff) | |
download | react-autosize-textarea-692aaad0484c453430039bdc4c0e71ebe1a0ffa5.zip react-autosize-textarea-692aaad0484c453430039bdc4c0e71ebe1a0ffa5.tar.gz react-autosize-textarea-692aaad0484c453430039bdc4c0e71ebe1a0ffa5.tar.bz2 |
use tcomb-react @props instead of React propTypes
Diffstat (limited to 'src')
-rw-r--r-- | src/TextareaAutosize.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/TextareaAutosize.js b/src/TextareaAutosize.js index ce258a7..e2f6068 100644 --- a/src/TextareaAutosize.js +++ b/src/TextareaAutosize.js @@ -1,16 +1,18 @@ import React from 'react'; import ReactDOM from 'react-dom'; import autosize from 'autosize'; +import { t, props } from 'tcomb-react'; const UPDATE = 'autosize:update', DESTROY = 'autosize:destroy', RESIZED = 'autosize:resized'; -export default class TextareaAutosize extends React.Component { +export const Props = { + onResize: t.maybe(t.Function) +}; - static propTypes = { - onResize: React.PropTypes.func - }; +@props(Props, { strict: false }) +export default class TextareaAutosize extends React.Component { static defaultProps = { rows: 1 |