File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33

44
const validSSRModes = ['resolve', 'defer', 'boundary']
5+
const staticModuleId = Symbol();
56

67
function asyncComponent(config) {
78
const {
@@ -11,7 +12,7 @@ function asyncComponent(config) {
1112
serverMode = 'resolve',
1213
LoadingComponent,
1314
ErrorComponent,
14-
getModuleId = () => 'staticKey',
15+
getModuleId = () => staticModuleId,
1516
} = config
1617

1718
if (validSSRModes.indexOf(serverMode) === -1) {
@@ -47,7 +48,7 @@ function asyncComponent(config) {
4748
: x
4849

4950
const getResolver = (props) => {
50-
if (sharedState.resolver == null) {
51+
if (sharedState.resolver == null || getModuleId(props) !== staticModuleId) {
5152
try {
5253
// Wrap whatever the user returns in Promise.resolve to ensure a Promise
5354
// is always returned.

0 commit comments

Comments
 (0)