File tree
Expand file treeCollapse file tree1 file changed
+3
-2
lines changed Expand file treeCollapse file tree1 file changed
+3
-2
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -2,6 +2,7 @@ import React from 'react'
|
2 | 2 | import PropTypes from 'prop-types'
|
3 | 3 |
|
4 | 4 | const validSSRModes = ['resolve', 'defer', 'boundary']
|
| 5 | +const staticModuleId = Symbol(); |
5 | 6 |
|
6 | 7 | function asyncComponent(config) {
|
7 | 8 | const {
|
@@ -11,7 +12,7 @@ function asyncComponent(config) {
|
11 | 12 | serverMode = 'resolve',
|
12 | 13 | LoadingComponent,
|
13 | 14 | ErrorComponent,
|
14 |
| -getModuleId = () => 'staticKey', |
| 15 | +getModuleId = () => staticModuleId, |
15 | 16 | } = config
|
16 | 17 |
|
17 | 18 | if (validSSRModes.indexOf(serverMode) === -1) {
|
@@ -47,7 +48,7 @@ function asyncComponent(config) {
|
47 | 48 | : x
|
48 | 49 |
|
49 | 50 | const getResolver = (props) => {
|
50 |
| -if (sharedState.resolver == null) { |
| 51 | +if (sharedState.resolver == null || getModuleId(props) !== staticModuleId) { |
51 | 52 | try {
|
52 | 53 | // Wrap whatever the user returns in Promise.resolve to ensure a Promise
|
53 | 54 | // is always returned.
|
|
You can’t perform that action at this time.
0 commit comments