-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e63832
commit d11c575
Showing
5 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/studio-plugin/tests/__fixtures__/ParsingOrchestrator/src/pages/_client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PageContext } from "@yext/pages"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
|
||
export { render }; | ||
|
||
const render = async (pageContext: PageContext<any>) => { | ||
const { Page, pageProps } = pageContext; | ||
const rootElement = document.getElementById("reactele"); | ||
if (rootElement) { | ||
hydrateRoot(rootElement, <Page {...pageProps} />); | ||
} | ||
}; |
19 changes: 19 additions & 0 deletions
19
packages/studio-plugin/tests/__fixtures__/ParsingOrchestrator/src/pages/_server.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as ReactDOMServer from "react-dom/server"; | ||
import { PageContext } from "@yext/pages"; | ||
|
||
export { render }; | ||
|
||
const render = async (pageContext: PageContext<any>) => { | ||
const { Page, pageProps } = pageContext; | ||
const viewHtml = ReactDOMServer.renderToString(<Page {...pageProps} />); | ||
return `<!DOCTYPE html> | ||
<html lang="<!--app-lang-->"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
<body> | ||
<div id="reactele">${viewHtml}</div> | ||
</body> | ||
</html>`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters