Check out example codes for "inline if in html component". It will help you in understanding the concepts better.

Code Example 1

Condition ? Block_For_True : Block_For_False

Learn ReactJs, React Native from akashmittal.com