React | Conditional Rendering | Question 5

Last Updated :
Discuss
Comments

Why might {isOpen && <Modal />} be preferred over {isOpen ? <Modal /> : null}?

It’s more explicit

It produces smaller bundle size

It avoids null checks in React’s reconciliation

Both are functionally identical, but && is cleaner

Share your thoughts in the comments