File tree Expand file tree Collapse file tree
packages/renderer-core/src/renderer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,17 +135,20 @@ export default function rendererFactory(): IRenderComponent {
135135 return engine . createElement ( engine . getFaultComponent ( ) , {
136136 ...this . props ,
137137 error : this . state . error ,
138+ componentName : this . props . _componentName
138139 } ) ;
139140 }
140141 return originRender . call ( this ) ;
141142 } ;
142- const originShouldComponentUpdate = SetComponent . prototype . shouldComponentUpdate ;
143- SetComponent . prototype . shouldComponentUpdate = function ( nextProps : IRendererProps , nextState : any ) {
144- if ( nextState && nextState . engineRenderError ) {
145- return true ;
146- }
147- return originShouldComponentUpdate ? originShouldComponentUpdate . call ( this , nextProps , nextState ) : true ;
148- } ;
143+ if ( ! ( SetComponent . prototype instanceof PureComponent ) ) {
144+ const originShouldComponentUpdate = SetComponent . prototype . shouldComponentUpdate ;
145+ SetComponent . prototype . shouldComponentUpdate = function ( nextProps : IRendererProps , nextState : any ) {
146+ if ( nextState && nextState . engineRenderError ) {
147+ return true ;
148+ }
149+ return originShouldComponentUpdate ? originShouldComponentUpdate . call ( this , nextProps , nextState ) : true ;
150+ } ;
151+ }
149152 }
150153
151154 createElement ( SetComponent : any , props : any , children ?: any ) {
You can’t perform that action at this time.
0 commit comments