Skip to content

Latest commit

 

History

History
5 lines (4 loc) · 256 Bytes

ternary-shortcut.md

File metadata and controls

5 lines (4 loc) · 256 Bytes
title
Ternary Shortcut

ReactJS allows the pattern showButton && <Button />. While in this specific case, it's slightly shorter, in general, try not to do this in JS. In ReasonReact, you need to use showButton ? <Button /> : ReasonReact.null.