From 9491ff59b4c65be6c0843bfd621b5324089d4692 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 28 Feb 2023 17:10:02 +0100 Subject: [PATCH] use `Array.prototype.find` --- crates/next-core/js/src/overlay/internal/container/Errors.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/next-core/js/src/overlay/internal/container/Errors.tsx b/crates/next-core/js/src/overlay/internal/container/Errors.tsx index c814f5cd30c24e..9cad9cb50b66d0 100644 --- a/crates/next-core/js/src/overlay/internal/container/Errors.tsx +++ b/crates/next-core/js/src/overlay/internal/container/Errors.tsx @@ -200,14 +200,14 @@ export function Errors({ issues, errors }: ErrorsProps) { const isClosable = true; const defaultTab = - TAB_PRIORITY.filter( + TAB_PRIORITY.find( (tabId) => ({ [TabId.TurbopackErrors]: turbopackErrors.length > 0, [TabId.TurbopackWarnings]: turbopackWarnings.length > 0, [TabId.RuntimeErrors]: hasErrors, }[tabId]) - )[0] ?? TabId.RuntimeErrors; + ) ?? TabId.RuntimeErrors; const [selectedTab, setSelectedTab] = React.useState(defaultTab);