Skip to content

Commit 5d98a35

Browse files
authored
Fix DocumentRenderer usage in server components (#1424)
1 parent 44afc1e commit 5d98a35

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

Diff for: .changeset/two-colts-confess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@keystatic/core': patch
3+
---
4+
5+
Fix `DocumentRenderer` usage in server components

Diff for: packages/keystatic/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@
280280
},
281281
"#markdoc": "./src/markdoc.js",
282282
"#base64": "./src/base64.ts",
283-
"#react-compiler-runtime": "./src/react-compiler-runtime.ts"
283+
"#react-compiler-runtime": {
284+
"react-server": "./src/react-compiler-runtime-react-server.ts",
285+
"default": "./src/react-compiler-runtime.ts"
286+
}
284287
}
285288
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const $empty = Symbol.for('react.memo_cache_sentinel');
2+
3+
export function c(size: number) {
4+
const $ = new Array(size);
5+
for (let ii = 0; ii < size; ii++) {
6+
$[ii] = $empty;
7+
}
8+
// @ts-ignore
9+
$[$empty] = true;
10+
return $;
11+
}

0 commit comments

Comments
 (0)