To perform server-side rendering, use renderStatic
from glamor, which takes a callback. Render your component inside the callback and all of the calls to css()
will be collected and generated html and css will be returned. This will also return an array of ids to rehydrate the styles for fast startup.
To perform rehydration, call rehydrate
with the array of ids returned by renderStatic
.
Example -
import { renderStatic } from 'glamor/server';