From 7adebacb4eadc6d52bc24a562b5cd9effac090b7 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Tue, 11 Jun 2024 13:28:43 -0400 Subject: [PATCH] Addressed comments --- packages/react-client/src/ReactFlightClient.js | 12 +++++------- packages/react-reconciler/src/ReactFiberBeginWork.js | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/react-client/src/ReactFlightClient.js b/packages/react-client/src/ReactFlightClient.js index bcfaab5bb375f..6cab281c0af7e 100644 --- a/packages/react-client/src/ReactFlightClient.js +++ b/packages/react-client/src/ReactFlightClient.js @@ -766,8 +766,10 @@ function createElement( createBlockedChunk(response); handler.value = element; handler.chunk = blockedChunk; - const freeze = Object.freeze.bind(Object, element.props); - blockedChunk.then(freeze, freeze); + if (__DEV__) { + const freeze = Object.freeze.bind(Object, element.props); + blockedChunk.then(freeze, freeze); + } return createLazyChunkWrapper(blockedChunk); } } else if (__DEV__) { @@ -1079,11 +1081,7 @@ function parseModelString( if (value[0] === '$') { if (value === '$') { // A very common symbol. - if ( - initializingHandler !== null && - isArray(parentObject) && - key === '0' - ) { + if (initializingHandler !== null && key === '0') { // We we already have an initializing handler and we're abound to enter // a new element, we need to shadow it because we're now in a new scope. // This is effectively the "begin" or "push" phase of Element parsing. diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 8a03e53f30a6f..5c759d9a52cf1 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -4129,7 +4129,7 @@ function beginWork( } case Throw: { // This represents a Component that threw in the reconciliation phase. - // So we'll rethrow here. This might be + // So we'll rethrow here. This might be a Thenable. throw workInProgress.pendingProps; } }