File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,10 +53,7 @@ class PluginErrorBoundary extends Component<
5353 if ( this . state . hasError && this . state . error ) {
5454 const FallbackComponent = this . props . fallback ;
5555 if ( FallbackComponent ) {
56- return React . createElement ( FallbackComponent , {
57- error : this . state . error ,
58- retry : this . handleRetry ,
59- } ) ;
56+ return < FallbackComponent error = { this . state . error } retry = { this . handleRetry } /> ;
6057 }
6158 return null ;
6259 }
@@ -136,17 +133,17 @@ export function createLazyPlugin<P extends object = any>(
136133 const LazyComponent = lazy ( retryImport ) ;
137134
138135 const PluginWrapper : React . FC < P > = ( props ) => {
139- const content = React . createElement (
140- Suspense ,
141- { fallback : options ?. fallback || null } ,
142- React . createElement ( LazyComponent , props ) ,
136+ const content = (
137+ < Suspense fallback = { options ?. fallback || null } >
138+ < LazyComponent { ... props } />
139+ </ Suspense >
143140 ) ;
144141
145142 if ( errorFallback ) {
146- return React . createElement (
147- PluginErrorBoundary ,
148- { fallback : errorFallback } ,
149- content ,
143+ return (
144+ < PluginErrorBoundary fallback = { errorFallback } >
145+ { content }
146+ </ PluginErrorBoundary >
150147 ) ;
151148 }
152149
You can’t perform that action at this time.
0 commit comments