File tree Expand file tree Collapse file tree
packages/renderer-core/src/hoc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ function patchDidCatch(Comp: any, { baseRenderer }: Options) {
4949 }
5050}
5151
52- const cache = new Map ( ) ;
52+ const cache = new Map < string , { Comp : any ; WrapperComponent : any } > ( ) ;
5353
5454export function compWrapper ( Comp : any , options : Options ) {
5555 const { createElement, Component, forwardRef } = adapter . getRuntime ( ) ;
@@ -62,8 +62,8 @@ export function compWrapper(Comp: any, options: Options) {
6262 return Comp ;
6363 }
6464
65- if ( cache . has ( options . schema . id ) ) {
66- return cache . get ( options . schema . id ) ;
65+ if ( cache . has ( options . schema . id ) && cache . get ( options . schema . id ) ?. Comp === Comp ) {
66+ return cache . get ( options . schema . id ) ?. WrapperComponent ;
6767 }
6868
6969 class Wrapper extends Component {
@@ -82,7 +82,7 @@ export function compWrapper(Comp: any, options: Options) {
8282 Comp ,
8383 ) ;
8484
85- cache . set ( options . schema . id , WrapperComponent ) ;
85+ cache . set ( options . schema . id , { WrapperComponent, Comp } ) ;
8686
8787 return WrapperComponent ;
8888}
You can’t perform that action at this time.
0 commit comments