Skip to content

Commit fcb8543

Browse files
authored
onData is supposed to be optional. Add optional chaining check
Otherwise it throws if no onData is provided.
1 parent f643d0d commit fcb8543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Retool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const Retool = ({ data, url, height, width, onData }) => {
3131
event.data?.type !== "PARENT_WINDOW_QUERY" &&
3232
event.data?.type !== 'intercom-snippet__ready'
3333
) {
34-
onData(event.data);
34+
onData?.(event.data);
3535
}
3636

3737
if (event.data.type === "PARENT_WINDOW_QUERY") {

0 commit comments

Comments
 (0)