A StyleSheet for server-side rendering
yarn add @filbert-js/server-stylesheet
1import { renderToString } from 'react-dom/server';2import { createStylesheet } from '@filbert-js/server-stylesheet';3import App from './App';45const sheet = createStylesheet();6const app = renderToString(sheet.collectStyles(<App />));7const styleHTML = sheet.getStyles();8// Or9// const styleTags = sheet.getReactElements(); // give React elements1011const html = `12<html>13 <head>${styleHTML}</head>14 <body>15 <div id="app">${app}</div>16 </body>17</html>18`;
More documentation is available at https://filbert-js.vercel.app.