Skip to content

inputMaxLength type error #15

@lilyzhaoyilu

Description

@lilyzhaoyilu

Hi,

I am using React & Redux. I copied your sample code from Readme and got this error message saying

#index.js:1 Warning: Failed prop type: Invalid prop inputMaxLength of type string supplied to EditableLabel, expected number.
at EditableLabel (http://localhost:3000/static/js/0.chunk.js:150704:7)
at CommentDetailForMedia (http://localhost:3000/static/js/main.chunk.js:2201:5

my code is

          <EditableLabel text={this.props.comment.text}
              labelClassName='media-comments-detail'
              inputClassName='media-comments-detail-edit'
              inputMaxLength='144'
              onFocus={this._handleFocus}
              onFocusOut={this._handleFocusOut}
          />

The functionality works, it is just the console has error messages.
I have also tried to

  1. change it to inputMaxLength=144 (did not work)
  2. delete " inputMaxLength='144" and add maxLength in corresponding CSS (did not work)

I think it is because you set the type of inputMaxLength to number but it is reading as a string...?

Appreciate if you can help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions