DEV Community

loading...

Discussion on: Hooked with React - Creating book details page using react router, Part 4

Collapse
paramharrison profile image
Paramanantham Harrison Author

Yes, second option is conditional loading. If the condition is false, then it won’t load the component

Collapse
syed456 profile image
syed

which way is more appropriate over other one is my confusion. I saw both the cases many places. It look conditional rendering is better for me, if I'm not wrong, since if condition is false, then no need for React to load Loader component , by this way we are optimizing the memory or whatever.