Check out example codes for "check if input is empty css". It will help you in understanding the concepts better.

Code Example 1

/* If input is not empty */
input:not(:placeholder-shown) {
  /* You need to add a placeholder to your fields. For example: <input "placeholder=" "/> */
  border-color: green;
}

/* If input is empty */
input:placeholder-shown {
  border-color: red;
}

Learn ReactJs, React Native from akashmittal.com