File tree Expand file tree Collapse file tree 1 file changed +29
-26
lines changed Expand file tree Collapse file tree 1 file changed +29
-26
lines changed Original file line number Diff line number Diff line change @@ -19,33 +19,36 @@ export default (opts = {}) => (Comp) => {
1919 reloadOnUpdate = false ,
2020 reloadDependents = null ,
2121 } = opts ;
22- const C = ( props ) => {
23- const { wrappedComponentRef, ...remainingProps } = props ;
24- const wrapperProps = {
25- batch,
26- asyncJobs,
27- asyncProps,
28- asyncPropOpts,
29- asyncPropsMapper,
30- errorComponent,
31- loadingComponent,
32- onError,
33- delay,
34- unwrapDefault,
35- reloadOnUpdate,
36- reloadDependents,
37- syncProps : {
38- ...remainingProps ,
39- ref : wrappedComponentRef ,
40- } ,
41- } ;
42- if ( isPromise ( Comp ) ) {
43- wrapperProps . asyncComponent = ( ) => Comp ;
44- } else {
45- wrapperProps . component = Comp ;
22+ // eslint-disable-next-line
23+ class C extends React . Component {
24+ render ( ) {
25+ const { wrappedComponentRef, ...remainingProps } = this . props ;
26+ const wrapperProps = {
27+ batch,
28+ asyncJobs,
29+ asyncProps,
30+ asyncPropOpts,
31+ asyncPropsMapper,
32+ errorComponent,
33+ loadingComponent,
34+ onError,
35+ delay,
36+ unwrapDefault,
37+ reloadOnUpdate,
38+ reloadDependents,
39+ syncProps : {
40+ ...remainingProps ,
41+ ref : wrappedComponentRef ,
42+ } ,
43+ } ;
44+ if ( isPromise ( Comp ) ) {
45+ wrapperProps . asyncComponent = ( ) => Comp ;
46+ } else {
47+ wrapperProps . component = Comp ;
48+ }
49+ return < AsyncComponent { ...wrapperProps } /> ;
4650 }
47- return < AsyncComponent { ...wrapperProps } /> ;
48- } ;
51+ }
4952 C . displayName = `makeAsync(${ ! isPromise ( Comp ) ? ( Comp . displayName || Comp . name ) : 'Unknown' } )` ;
5053 C . propTypes = {
5154 // eslint-disable-next-line
You can’t perform that action at this time.
0 commit comments