From bce4a81ddd00965a070d1941cff2540ec1778d13 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Sun, 21 Jan 2024 17:20:24 +0100 Subject: [PATCH] fix: workaround dev tool issue (fix #25) --- packages/vike-react/renderer/+config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/vike-react/renderer/+config.ts b/packages/vike-react/renderer/+config.ts index e3a41050..6e434f0c 100644 --- a/packages/vike-react/renderer/+config.ts +++ b/packages/vike-react/renderer/+config.ts @@ -28,6 +28,11 @@ export default { // https://vike.dev/onRenderClient onRenderClient: 'import:vike-react/renderer/onRenderClient:onRenderClient', + passToClient: [ + // https://github.com/vikejs/vike-react/issues/25 + process.env.NODE_ENV === 'production' && '$$typeof' + ].filter(isNotFalse), + // https://vike.dev/clientRouting clientRouting: true, hydrationCanBeAborted: true, @@ -112,3 +117,7 @@ declare global { } } } + +function isNotFalse(val: T | false): val is T { + return val !== false +}