Check out example codes for "boostrap 4 clear input". It will help you in understanding the concepts better.

Code Example 1

<div class="input-group">
    <input type="text" class="form-control" placeholder="Search...">
    <button class="btn bg-transparent" style="margin-left: -40px; z-index: 100;">
      <i class="fa fa-times"></i>
    </button>
</div>

Learn ReactJs, React Native from akashmittal.com