File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ export function makeImmutable<T extends React.ComponentType<any>>(Component: T):
2828export function responseImmutable < T extends React . ComponentType < any > > ( Component : T ) : T {
2929 const refAble = supportRef ( Component ) ;
3030
31- const ImmutableComponent = function ( props : any , ref : any ) {
31+ const ImmutableComponent = React . memo ( function ( props : any , ref : any ) {
3232 const refProps = refAble ? { ref } : { } ;
33- const renderTimes = React . useContext ( RenderContext ) ;
33+ React . useContext ( RenderContext ) ;
3434
35- return React . useMemo ( ( ) => < Component { ...props } { ...refProps } /> , [ renderTimes ] ) ;
36- } ;
35+ return < Component { ...props } { ...refProps } /> ;
36+ } ) ;
3737
3838 if ( process . env . NODE_ENV !== 'production' ) {
3939 ImmutableComponent . displayName = `ImmutableResponse(${
You can’t perform that action at this time.
0 commit comments