File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -205,25 +205,22 @@ class OutPortal<C extends Component<any>> extends React.PureComponent<OutPortalP
205205 this . passPropsThroughPortal ( ) ;
206206 }
207207
208- componentDidUpdate ( prevProps : OutPortalProps < C > ) {
208+ componentDidUpdate ( ) {
209209 // We re-mount on update, just in case we were unmounted (e.g. by
210210 // a second OutPortal, which has now been removed)
211211 const node = this . props . node as AnyPortalNode < C > ;
212- const prevNode = prevProps . node
213212
214213 // If we're switching portal nodes, we need to clean up the current one first.
215214 if ( this . currentPortalNode && node !== this . currentPortalNode ) {
216215 this . currentPortalNode . unmount ( this . placeholderNode . current ! ) ;
216+ this . currentPortalNode . setPortalProps ( { } as ComponentProps < C > ) ;
217217 this . currentPortalNode = node ;
218218 }
219219
220220 const placeholder = this . placeholderNode . current ! ;
221221 const parent = placeholder . parentNode ! ;
222222 node . mount ( parent , placeholder ) ;
223223 this . passPropsThroughPortal ( ) ;
224- if ( prevNode !== node ) {
225- prevNode . setPortalProps ( { } as ComponentProps < C > ) ;
226- }
227224 }
228225
229226 componentWillUnmount ( ) {
You can’t perform that action at this time.
0 commit comments