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 | |
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
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | src/TextareaAutosize.js | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/package.json b/package.json index aa256d6..b01a95d 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "react-dom": "^0.14.0 || ^15.0.0" }, "dependencies": { - "autosize": "^3.0.15" + "autosize": "^3.0.15", + "tcomb-react": "^0.9.3" } } 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 |