To be honest this should be something more like if (products.length === 0) return null.
Basically all I'm doing here is making it so the component doesn't fail if no products are returned from Commerce.js - this hasn't really anything to do with SSR since it would fail there if products was undefined in its current state.
To be honest this should be something more like
if (products.length === 0) return null
.Basically all I'm doing here is making it so the component doesn't fail if no products are returned from Commerce.js - this hasn't really anything to do with SSR since it would fail there if
products
was undefined in its current state.I hope that helps :)
Alright, that makes sense. Thanks a lot!