All files / src/components/TextArea index.jsx

0% Statements 0/28
0% Branches 0/10
0% Functions 0/3
0% Lines 0/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                                   
import styles from './style.postcss';
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import pure from 'recompose/pure';
 
const DEFAULT_MAX_LENGTH = 500;
 
const TextArea = (props) => {
  const { value, onChange, maxLength, className } = props;
  return <textarea onChange={onChange}
      maxLength={maxLength || DEFAULT_MAX_LENGTH}
      value={value}
      {...props}
      className={classnames(styles.TextArea, className)} />;
};
 
TextArea.propTypes = {
  className: PropTypes.string,
  value: PropTypes.string,
  onChange: PropTypes.func,
  maxLength: PropTypes.number,
};
 
export default pure(TextArea);