@@ -15,7 +15,6 @@ import {
1515 enableBinaryFlight ,
1616 enablePostpone ,
1717 enableTaint ,
18- enableServerComponentKeys ,
1918 enableRefAsProp ,
2019 enableServerComponentLogs ,
2120} from 'shared/ReactFeatureFlags' ;
@@ -993,7 +992,7 @@ function renderFragment(
993992 task : Task ,
994993 children : $ReadOnlyArray < ReactClientValue > ,
995994): ReactJSONValue {
996- if ( enableServerComponentKeys && task . keyPath !== null ) {
995+ if ( task . keyPath !== null ) {
997996 // We have a Server Component that specifies a key but we're now splitting
998997 // the tree using a fragment.
999998 const fragment = [
@@ -1052,7 +1051,7 @@ function renderAsyncFragment(
10521051 children: $AsyncIterable< ReactClientValue , ReactClientValue , void > ,
10531052 getAsyncIterator: () => $AsyncIterator < any , any , any > ,
10541053): ReactJSONValue {
1055- if ( enableServerComponentKeys && task . keyPath !== null ) {
1054+ if ( task . keyPath !== null ) {
10561055 // We have a Server Component that specifies a key but we're now splitting
10571056 // the tree using a fragment.
10581057 const fragment = [
@@ -1095,11 +1094,6 @@ function renderClientElement(
10951094 props : any ,
10961095 owner : null | ReactComponentInfo , // DEV-only
10971096) : ReactJSONValue {
1098- if ( ! enableServerComponentKeys ) {
1099- return __DEV__
1100- ? [ REACT_ELEMENT_TYPE , type , key , props , owner ]
1101- : [ REACT_ELEMENT_TYPE , type , key , props ] ;
1102- }
11031097 // We prepend the terminal client element that actually gets serialized with
11041098 // the keys of any Server Components which are not serialized.
11051099 const keyPath = task . keyPath ;
@@ -1266,7 +1260,7 @@ function createTask(
12661260 if ( typeof model === 'object' && model !== null ) {
12671261 // If we're about to write this into a new task we can assign it an ID early so that
12681262 // any other references can refer to the value we're about to write.
1269- if ( enableServerComponentKeys && ( keyPath !== null || implicitSlot ) ) {
1263+ if ( keyPath !== null || implicitSlot ) {
12701264 // If we're in some kind of context we can't necessarily reuse this object depending
12711265 // what parent components are used.
12721266 } else {
@@ -1756,10 +1750,7 @@ function renderModelDestructive(
17561750 const writtenObjects = request . writtenObjects ;
17571751 const existingId = writtenObjects . get ( value ) ;
17581752 if ( existingId !== undefined ) {
1759- if (
1760- enableServerComponentKeys &&
1761- ( task . keyPath !== null || task . implicitSlot )
1762- ) {
1753+ if ( task . keyPath !== null || task . implicitSlot ) {
17631754 // If we're in some kind of context we can't reuse the result of this render or
17641755 // previous renders of this element. We only reuse elements if they're not wrapped
17651756 // by another Server Component.
@@ -1889,10 +1880,7 @@ function renderModelDestructive(
18891880 // $FlowFixMe[method-unbinding]
18901881 if ( typeof value . then === 'function' ) {
18911882 if ( existingId !== undefined ) {
1892- if (
1893- enableServerComponentKeys &&
1894- ( task . keyPath !== null || task . implicitSlot )
1895- ) {
1883+ if ( task . keyPath !== null || task . implicitSlot ) {
18961884 // If we're in some kind of context we can't reuse the result of this render or
18971885 // previous renders of this element. We only reuse Promises if they're not wrapped
18981886 // by another Server Component.
0 commit comments