From 2de23a34586b3c81e4db4b6461c0bb4f8aed5b33 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 8 Oct 2022 15:33:23 -0700 Subject: [PATCH] Only client-render server-rendered templates in production builds. Closes #2176 --- .../ServerRenderedHydration.tsx | 10 +++++ .../ServerRendered/ServerRenderedMetadata.tsx | 34 +++++++++++++++ web/components/layouts/Main.tsx | 41 +++++-------------- 3 files changed, 54 insertions(+), 31 deletions(-) create mode 100644 web/components/ServerRendered/ServerRenderedHydration.tsx create mode 100644 web/components/ServerRendered/ServerRenderedMetadata.tsx diff --git a/web/components/ServerRendered/ServerRenderedHydration.tsx b/web/components/ServerRendered/ServerRenderedHydration.tsx new file mode 100644 index 000000000..5eb3d8ce9 --- /dev/null +++ b/web/components/ServerRendered/ServerRenderedHydration.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; + +export type ServerRenderedHydrationProps = { + hydrationScript: string; +}; + +export const ServerRenderedHydration: FC = ({ hydrationScript }) => ( + // eslint-disable-next-line react/no-danger +