File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2209,6 +2209,7 @@ var ReactDOMServerRenderer = function () {
2209
2209
--- Component caching variables ---
2210
2210
start: Tracks start index in output string and templatization data for cached components
2211
2211
saveTemplates: Tracks templatized components so props can be restored in output string
2212
+ loadedTemplates: Stores templates that have already been fetched from the cache so that the same template is not fetched several times
2212
2213
restoreProps: Restores actual props to a templatized component
2213
2214
*/
2214
2215
const start = { } ;
@@ -2270,7 +2271,7 @@ var ReactDOMServerRenderer = function () {
2270
2271
// Generate template placeholders and lookup object for referencing prop names from placeholders
2271
2272
templatizedProps . forEach ( ( templatizedProp , index ) => {
2272
2273
const placeholder = `{{${ index } }}` ;
2273
- cacheProps [ templatizedProp ] = placeholder ;
2274
+ cacheProps [ templatizedProp ] = placeholder ;
2274
2275
lookup [ placeholder ] = templatizedProp ; // Move down to next if statement? (Extra work/space if not generating template)
2275
2276
} ) ;
2276
2277
@@ -2290,7 +2291,7 @@ var ReactDOMServerRenderer = function () {
2290
2291
let r ;
2291
2292
let restoredTemplate ;
2292
2293
2293
- if ( loadedTemplates [ cacheKey ] ) { // Component found in loaded templates
2294
+ if ( isTemplate && loadedTemplates [ cacheKey ] ) { // Component found in loaded templates
2294
2295
restoredTemplate = restoreProps ( loadedTemplates [ cacheKey ] , realProps , lookup ) ;
2295
2296
} else {
2296
2297
let reply = cache . get ( cacheKey ) ;
You can’t perform that action at this time.
0 commit comments