Pass maxLength directly to TextInput component

This commit is contained in:
Alex Gleason 2020-04-22 16:38:16 -05:00
parent 6fe57ca055
commit 1b1bf4cdbe
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 2 additions and 4 deletions

View file

@ -92,6 +92,7 @@ class EditProfile extends ImmutablePureComponent {
name='display_name'
value={this.state.display_name}
maxLength={30}
size={30}
onChange={this.handleTextChange}
/>
<TextInput

View file

@ -191,11 +191,10 @@ export class TextInput extends ImmutablePureComponent {
static propTypes = {
label: PropTypes.string,
maxLength: PropTypes.number,
}
render() {
const { label, maxLength, ...props } = this.props;
const { label, ...props } = this.props;
const id = uuidv4();
return (
@ -204,9 +203,7 @@ export class TextInput extends ImmutablePureComponent {
<label className='string optional' htmlFor={id}>{label}</label>
<div className='label_input__wrapper'>
<input
maxlength={maxLength}
className='string optional'
size={maxLength}
type='text'
id={id}
{...props}