Hi Yoav, thanks for this article. I noticed that you used the style attribute in your remote Nav component. Did you try using CSS Modules to style the Nav component, and how do you retrieve the link or style tags to insert into the SSR-ed HTML markup?
Hi Shun,
Delighted you liked the article :-)
I have actually not tried using CSS modules in this example, but I believe it would be possible to do so. I might be mistaken, but I think that if you do use them in a remote component the CSS would be bundled with the federated component.
Well... went on and tried just so I can see that I was right, and indeed it does work :-)
There's no need to retrieve any link or style tag - the federated code has it all.
You can check out this branch that shows it working.
Hi Yoav, thanks for this article. I noticed that you used the
style
attribute in your remoteNav
component. Did you try using CSS Modules to style theNav
component, and how do you retrieve thelink
orstyle
tags to insert into the SSR-ed HTML markup?Next.js docs on CSS Modules support
Hi Shun,
Delighted you liked the article :-)
I have actually not tried using CSS modules in this example, but I believe it would be possible to do so. I might be mistaken, but I think that if you do use them in a remote component the CSS would be bundled with the federated component.
Well... went on and tried just so I can see that I was right, and indeed it does work :-)
There's no need to retrieve any
link
orstyle
tag - the federated code has it all.You can check out this branch that shows it working.
Hope this helps!
Thanks for your prompt response!