DEV Community

Discussion on: Dynamic image placeholder in Next.js

Collapse
 
ziyak97 profile image
Ziyak Jehangir

This is awesome! I assume there would also be no layout shifts because the svg generated will take up the appropriate width and height? Also this would cause a layout shift if the svg is send via a server and then populated client side correct?

Collapse
 
codegino profile image
Carlo Gino Catapang • Edited

Thanks for the feedback. There should be no layout shift if svg is send using getStaticProps or getServerSideProps. However, if svg is populated in the client(e.g.useEffect) there will be, which is not a use case for this solution.