Skip to content

Commit 131c961

Browse files
fix: ref check in mutation observer (#139)
1 parent ab767fc commit 131c961

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/usePlacesWidget.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ export default function usePlacesWidget(props) {
104104
observerHack.current = new MutationObserver(() => {
105105
observerHack.current.disconnect();
106106

107-
inputRef.current.autocomplete = inputAutocompleteValue;
107+
if (inputRef.current) {
108+
inputRef.current.autocomplete = inputAutocompleteValue;
109+
}
108110
});
109111
observerHack.current.observe(inputRef.current, {
110112
attributes: true,

0 commit comments

Comments
 (0)