File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import PortaledModal , { ModalProps } from '@/components/elements/Modal' ;
33import ModalContext , { ModalContextValues } from '@/context/ModalContext' ;
4+ import isEqual from 'react-fast-compare' ;
45
56export interface AsModalProps {
67 visible : boolean ;
@@ -47,13 +48,13 @@ function asModal<P extends {}> (modalProps?: SettableModalProps | ((props: P) =>
4748 /**
4849 * @this {React.PureComponent<P & AsModalProps, State>}
4950 */
50- componentDidUpdate ( prevProps : Readonly < P & AsModalProps > ) {
51+ componentDidUpdate ( prevProps : Readonly < P & AsModalProps > , prevState : Readonly < State > ) {
5152 if ( prevProps . visible && ! this . props . visible ) {
5253 this . setState ( { visible : false , showSpinnerOverlay : false } ) ;
5354 } else if ( ! prevProps . visible && this . props . visible ) {
5455 this . setState ( { render : true , visible : true } ) ;
5556 }
56- if ( ! this . state . render ) {
57+ if ( ! this . state . render && ! isEqual ( prevState . propOverrides , this . state . propOverrides ) ) {
5758 this . setState ( { propOverrides : { } } ) ;
5859 }
5960 }
You can’t perform that action at this time.
0 commit comments