Skip to main content

Meetup 9: CSS for server rendered React components without Node.js (continued)

· One min read
Manas Jayanth
Managing Partner at Dining Philosophers, LLP.

We continued the development of our Dream powered Server Side rendered React components (without node.js) with styled-ppx

styled-ppx working only on Client side

Commit

We used Melange compiler to compile Reason to JS, which is fed to webpack.

Making sure it works on server side.

Commit

We use CssJs.render_style_tag() to generated server side rendered CSS to inject into the style tag.

Dynamic CSS props

Commit

This was uncharted territory. Thankfully, @davesnx had given a heads-up! The CSS rendering, render_style_tag must be called only after React components are rendered.

Join us on Discord if you'd like to learn more about this.


We contributed some documentation too! You can find the pull request here

Next Meetup

We learn how to use a Router for this very same server Learn more about it here

Stay in touch with us


Twitter: https://x.com/ReasonBangalore

Discord: https://discord.com/invite/Ytr36fRC4C