File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-var-requires */
12import { styles as defaultStyles } from "@dash-ui/styles" ;
23import type { Styles } from "@dash-ui/styles" ;
34import { createStylesFromString } from "@dash-ui/styles/server" ;
45import * as React from "react" ;
5- import { renderToStaticMarkup } from "react-dom/server" ;
66
77/**
88 * A function for creating a React `<style>` component for
@@ -85,8 +85,10 @@ export interface StyleProps {
8585export function createGatsbyRenderer ( styles : Styles < any , any > = defaultStyles ) {
8686 /* istanbul ignore next */
8787 return function replaceRenderer < P = any > ( props : P ) : P {
88- // @ts -expect-error
89- const bodyString = renderToStaticMarkup ( props . bodyComponent ) ;
88+ const bodyString = require ( "react-dom/server" ) . renderToStaticMarkup (
89+ // @ts -expect-error
90+ props . bodyComponent
91+ ) ;
9092 // @ts -expect-error
9193 props . setHeadComponents ( [ toComponent ( bodyString , styles ) ] ) ;
9294 return props ;
You can’t perform that action at this time.
0 commit comments