Skip to content

Commit

Permalink
Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Nov 20, 2018
1 parent c954efa commit 327cf0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-dom/src/server/ReactPartialRendererContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ export function validateContextBounds(
context: ReactContext<any>,
threadID: ThreadID,
) {
// If `react` package is < 16.6, _threadCount is undefined.
let initialThreadCount = context._threadCount || 0;
// If we don't have enough slots in this context to store this threadID,
// fill it in without leaving any holes to ensure that the VM optimizes
// this as non-holey index properties.
for (let i = context._threadCount; i <= threadID; i++) {
for (let i = initialThreadCount; i <= threadID; i++) {
// We assume that this is the same as the defaultValue which might not be
// true if we're rendering inside a secondary renderer but they are
// secondary because these use cases are very rare.
Expand Down

0 comments on commit 327cf0e

Please sign in to comment.