Skip to content

Difficulty mixing both SSR and CSR support in the same binary #3332

Answered by gbj
azriel91 asked this question in Q&A
Discussion options

You must be logged in to vote

Normally <head> is where <link> and <stylesheet> are expected to live

This is true, but I think the conclusions you're drawing/the trains of thought you're going down are based on a misunderstanding. The leptos_meta components <Stylesheet/> and <Link/> can be used anywhere, and insert the appropriate tags into the <head>; that is their primary purpose. Whether you're using them in CSR or in SSR, they will end up in the <head>, wherever in the app you use them.

If you are using Trunk for CSR, your index.html fulfills the same function that the shell function fulfills in SSR mode.

So, if you have a few static stylesheets or <link> tags, you can either

  1. use <Stylesheet/> and <Link/> from l…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@azriel91
Comment options

@gbj
Comment options

gbj Dec 8, 2024
Maintainer

Answer selected by azriel91
@azriel91
Comment options

@gbj
Comment options

gbj Dec 8, 2024
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants