DEV Community

Discussion on: 4 Ways to Render JSX Conditionally in React

Collapse
 
rasaf_ibrahim profile image
Rasaf Ibrahim

Yes, you can definitely do that as we know whenever JavaScript sees the return keyword, it immediately exits the function.