Skip to content

Commit 0c8e943

Browse files
Hemant-yadavtomchentw
authored andcommitted
fix(places/SearchBox): undefined child at unmount
Google Maps Api error can cause removal of searchBox which can results into an error at unmount while trying to append undefined to containerElement
1 parent 57a701f commit 0c8e943

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/macros/places/SearchBox.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ export class SearchBox extends React.PureComponent {
145145
const child = this.context[MAP].controls[
146146
this.props.controlPosition
147147
].removeAt(this.mountControlIndex)
148-
this.containerElement.appendChild(child)
148+
if(child !== undefined){
149+
this.containerElement.appendChild(child)
150+
}
149151
}
150152
}
151153

0 commit comments

Comments
 (0)