Check out example codes for "detect if an element has a class jQurey". It will help you in understanding the concepts better.

Code Example 1

$("#EL_ID").hasClass("CLASS_NAME");

Learn ReactJs, React Native from akashmittal.com