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 @@ -2212,6 +2212,7 @@ var ReactDOMServerRenderer = function () {
2212
2212
--- Component caching variables ---
2213
2213
start: Tracks start index in output string and templatization data for cached components
2214
2214
saveTemplates: Tracks templatized components so props can be restored in output string
2215
+ loadedTemplates: Stores templates that have already been fetched from the cache so that the same template is not fetched several times
2215
2216
restoreProps: Restores actual props to a templatized component
2216
2217
getAsync: Convert asynchronous get method into a promise
2217
2218
*/
@@ -2274,7 +2275,7 @@ var ReactDOMServerRenderer = function () {
2274
2275
// Generate template placeholders and lookup object for referencing prop names from placeholders
2275
2276
templatizedProps . forEach ( ( templatizedProp , index ) => {
2276
2277
const placeholder = `{{${ index } }}` ;
2277
- cacheProps [ templatizedProp ] = placeholder ;
2278
+ cacheProps [ templatizedProp ] = placeholder ;
2278
2279
lookup [ placeholder ] = templatizedProp ; // Move down to next if statement? (Extra work/space if not generating template)
2279
2280
} ) ;
2280
2281
@@ -2296,7 +2297,7 @@ var ReactDOMServerRenderer = function () {
2296
2297
let r ;
2297
2298
let restoredTemplate ;
2298
2299
2299
- if ( loadedTemplates [ cacheKey ] ) { // Component found in loaded templates
2300
+ if ( isTemplate && loadedTemplates [ cacheKey ] ) { // Component found in loaded templates
2300
2301
restoredTemplate = restoreProps ( loadedTemplates [ cacheKey ] , realProps , lookup ) ;
2301
2302
} else {
2302
2303
const reply = await getAsync ( cacheKey ) ;
You can’t perform that action at this time.
0 commit comments