Post

maybe dumb question but why is this a problem? this basically means they get inlined into initial HTML (ok maybe a bit silly) and then driven from DOM for new renders. “use client” does NOT mean “exclude me from HTML”

0 reposts1 like

The problem is that they end up in the client-side JavaScript bundle, in addition to already being in the HTML, right? Also, 1MB of JS is much more expensive to the browser than 1MB of images.

well it needs to be in the client-side bundle so that client-side code is able to render these at will for other screens, popups, and everything else that isn’t part of the initial paint

i agree it would be perfectly fine to roll them into .svg file instead. generally i think people avoid that because inline svg is easier to style than external references? i don’t remember exact problems tbh

I have added a 'use client' on a static jsx file because I don't want the react flight data in the html. Removing double data in the html. I have had issues from my SEO partners complaining about JSON+LD being twice in the HTML script tag and RSC data.