From f3579160420ce7c6ab28c21cb63564074a08cd23 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Sun, 21 Feb 2021 10:31:23 +0100 Subject: [PATCH] fix: event table fails to render in detail view The `EventsTable` component failed to render in the detail view, because the `onDataLoad` property is called but none was provided. See the issue for details. Add a nullcheck to `onDataLoad` before calling it. Refs #495 --- components/metrics/EventsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/metrics/EventsTable.js b/components/metrics/EventsTable.js index 5599bc2e..e497a25e 100644 --- a/components/metrics/EventsTable.js +++ b/components/metrics/EventsTable.js @@ -19,7 +19,7 @@ export default function EventsTable({ websiteId, ...props }) { function handleDataLoad(data) { setEventTypes([...new Set(data.map(({ x }) => x.split('\t')[0]))]); - props.onDataLoad(data); + props.onDataLoad?.(data); } return (