Skip to content

Commit

Permalink
Encode fragments properly in DEV
Browse files Browse the repository at this point in the history
Normally we take the renderClientElement path but this is an internal fast path.
  • Loading branch information
sebmarkbage committed Jun 4, 2024
1 parent ba099e4 commit 1a27b0c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,12 +1215,11 @@ function renderFragment(
if (task.keyPath !== null) {
// We have a Server Component that specifies a key but we're now splitting
// the tree using a fragment.
const fragment = [
REACT_ELEMENT_TYPE,
REACT_FRAGMENT_TYPE,
task.keyPath,
{children},
];
const fragment = __DEV__
? enableOwnerStacks
? [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {children}, null, null, 0]
: [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {children}, null]
: [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {children}];
if (!task.implicitSlot) {
// If this was keyed inside a set. I.e. the outer Server Component was keyed
// then we need to handle reorders of the whole set. To do this we need to wrap
Expand Down

0 comments on commit 1a27b0c

Please sign in to comment.