Check out example codes for "size not allowed on input html". It will help you in understanding the concepts better.

Code Example 1

<!DOCTYPE html>
<html>
   <head>
      <title>HTML maxlength attribute</title>
   </head>
   <body>
      <form action = "/cgi-bin/hello_get.cgi" method = "get">
         Student Name:
         <br>
         <input type = "text" name = "first_name" value = "" maxlength = "40" />
         <br>
         Student Subject: <br>
         <input type = "text" name = "last_name" value = "" maxlength = "30" />
         <br>
         <input type = "submit" value ="Submit" />
      </form>
   </body>
</html>

Learn ReactJs, React Native from akashmittal.com