user10336550
user10336550

Reputation:

Why can't I use maxLength in input?

I get an Error when I add maxLength to input,Invalid DOM property maxlength. Did you mean maxLength?https://codesandbox.io/s/nkz2kwl7y0

Upvotes: 1

Views: 2707

Answers (2)

dileepkumar jami
dileepkumar jami

Reputation: 2265

Class names and attributes in reactjs are camelCased. You should use maxLength instead of maxlength

Upvotes: 0

Umair Farooq
Umair Farooq

Reputation: 1823

This is because in jsx html attributes are in camelCase Please check supported html attributes in reactjs

Upvotes: 7

Related Questions