From 8887e1b51565b992f34c955c459125eb85b28483 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Mon, 31 Oct 2022 22:48:30 +0300
Subject: `useVisitor` hook
---
vnext/server/middleware/renderer.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'vnext/server')
diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js
index a4b745f8..ca2ac2df 100644
--- a/vnext/server/middleware/renderer.js
+++ b/vnext/server/middleware/renderer.js
@@ -7,6 +7,7 @@ import App from '../../src/App';
import { getLinks } from '../sape';
import { StaticRouter } from 'react-router-dom/server';
+import { VisitorProvider } from '../../src/ui/VisitorContext';
const path = require('path');
const fs = require('fs');
@@ -49,9 +50,11 @@ const serverRenderer = async (req, res) => {
const propsData = `${marker}`;
let didError = false;
const { pipe } = ReactDOMServer.renderToPipeableStream(
-
-
-
+
+
+
+
+
, {
onShellReady() {
res.statusCode = didError ? 500 : 200;
--
cgit v1.2.3