React: Conditionally Rendering Components with Ternary OperatorTao Liu·Follow1 min read·Feb 3, 2019--ListenShareThe code below shows how a ternary operator can be used inside Components. The ColorBox component recursively renders itself until the opacity prop goes below 0.2.Here is what ends up on the DOM: