Skip to content

Commit

Permalink
GitBook: [#13] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej authored and gitbook-bot committed Jan 22, 2022
1 parent d0ea3f1 commit d8b2c82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ssr/other-backend.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: Configure SSR in in frameworks other than Next.js like for example Express.js
---

# Other backend

```
Expand All @@ -6,7 +10,7 @@ yarn add @emotion/server

```tsx
import createEmotionServer from "@emotion/server/create-instance";
import { renderToString } from "react-dom/server"
import { renderToString } from "react-dom/server";
import { getTssDefaultEmotionCache } from "tss-react";

let muiCache: EmotionCache | undefined = undefined;
Expand All @@ -29,7 +33,7 @@ function functionInChargeOfRenderingTheHtml(res) {
const html = renderToString(
<CacheProvider value={muiCache ?? createMuiCache()}>
<App />
</CacheProvider>,
</CacheProvider>
);

res.status(200).header("Content-Type", "text/html").send([
Expand Down

0 comments on commit d8b2c82

Please sign in to comment.