Check out example codes for "accept zip codes in html". It will help you in understanding the concepts better.

Code Example 1

<label>ZIP Code</label><input type="text" pattern="[0-9]{5}" title="Five digit zip code" />

Learn ReactJs, React Native from akashmittal.com