File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,8 @@ class Modal extends React.Component {
207207 if ( props . ariaHideApp ) {
208208 checkAppElementIsSet ( ) ;
209209 }
210+
211+ this . selfRef = React . createRef ( ) ;
210212 }
211213
212214 componentDidMount ( ) {
@@ -224,14 +226,13 @@ class Modal extends React.Component {
224226 // and manager.jsx are removed. They appear to have
225227 // been created in order to do modals in portals.
226228 if ( ! this . isUnmounting ) {
227- const el = ReactDOM . findDOMNode ( this ) ; // eslint-disable-line react/no-find-dom-node
228229 if (
229- el &&
230- el . parentNode &&
231- el . parentNode . getAttribute ( 'data-slds-modal' )
230+ this . selfRef &&
231+ this . selfRef . parentNode &&
232+ this . selfRef . parentNode . getAttribute ( 'data-slds-modal' )
232233 ) {
233- ReactDOM . unmountComponentAtNode ( el ) ;
234- document . body . removeChild ( el ) ;
234+ ReactDOM . unmountComponentAtNode ( this . selfRef ) ;
235+ document . body . removeChild ( this . selfRef ) ;
235236 }
236237 }
237238 }
You can’t perform that action at this time.
0 commit comments