Sandro Jhuliano Cagara Posted on Jun 5, 2022 • Edited on Jun 7, 2022 React - JSX Conditional #react #jsx #webdev #javascript Instead of const MyComponent = () => { return isTrue ? <p>True!</p> : null }; Enter fullscreen mode Exit fullscreen mode Use short-circuit evaluation const MyComponent = () => { return isTrue && <p>True!</p> }; Enter fullscreen mode Exit fullscreen mode Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)