Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291)
Dan Abramov committed
Nov 20, 2018 at 13:09 UTC
327cf0ee3380d2a135802b268e95ab9253123927
1 file changed
+3
-1
packages/react-dom/src/server/ReactPartialRendererContext.js
+3
-1
@@ -56,10 +56,12 @@ export function validateContextBounds(
56
context: ReactContext<any>,
57
threadID: ThreadID,
58
) {
59
+ // If `react` package is < 16.6, _threadCount is undefined.
60
+ let initialThreadCount = context._threadCount || 0;
61
// If we don't have enough slots in this context to store this threadID,
62
// fill it in without leaving any holes to ensure that the VM optimizes
63
// this as non-holey index properties.
62
- for (let i = context._threadCount; i <= threadID; i++) {
64
+ for (let i = initialThreadCount; i <= threadID; i++) {
65
// We assume that this is the same as the defaultValue which might not be
66
// true if we're rendering inside a secondary renderer but they are
67
// secondary because these use cases are very rare.