Skip to content

Commit 327cf0e

Browse files
authored
Fix support for mixing react-dom/[email protected] and react@<16.6 (#14291)
1 parent c954efa commit 327cf0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dom/src/server/ReactPartialRendererContext.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ export function validateContextBounds(
5656
context: ReactContext<any>,
5757
threadID: ThreadID,
5858
) {
59+
// If `react` package is < 16.6, _threadCount is undefined.
60+
let initialThreadCount = context._threadCount || 0;
5961
// If we don't have enough slots in this context to store this threadID,
6062
// fill it in without leaving any holes to ensure that the VM optimizes
6163
// this as non-holey index properties.
62-
for (let i = context._threadCount; i <= threadID; i++) {
64+
for (let i = initialThreadCount; i <= threadID; i++) {
6365
// We assume that this is the same as the defaultValue which might not be
6466
// true if we're rendering inside a secondary renderer but they are
6567
// secondary because these use cases are very rare.

0 commit comments

Comments
 (0)