DEV Community

Discussion on: A Clean Way to Conditionally Render Components

Collapse
 
anxiny profile image
Anxiny • Edited

If you mean the render of <If/> component will be executed regardless of the condition, that is true. But I don't think it will cause any error itself.

For performance, so far I don't feel any drawback of using this approach since it does not render its children when condition if false as I mentioned previously.
It should be very similar to the <Route/> in React-Router.

Best