From b8386624e0f1ebb51843990e18dcc4d27b1feb60 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 21 May 2024 18:10:33 +0100 Subject: [PATCH] Review Suggestions --- packages/dataviews/src/filter-summary.tsx | 2 +- packages/dataviews/src/filters.tsx | 2 +- packages/dataviews/src/search-widget.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dataviews/src/filter-summary.tsx b/packages/dataviews/src/filter-summary.tsx index a9f6fc7c368095..da4b2e840a297f 100644 --- a/packages/dataviews/src/filter-summary.tsx +++ b/packages/dataviews/src/filter-summary.tsx @@ -218,7 +218,7 @@ export default function FilterSummary( { openedFilter, ...commonProps }: FilterSummaryProps ) { - const toggleRef = useRef< HTMLDivElement | null >( null ); + const toggleRef = useRef< HTMLDivElement >( null ); const { filter, view, onChangeView } = commonProps; const filterInView = view.filters.find( ( f ) => f.field === filter.field ); const activeElements = filter.elements.filter( ( element ) => { diff --git a/packages/dataviews/src/filters.tsx b/packages/dataviews/src/filters.tsx index d1ce4846d9ed91..df7a13b2953f16 100644 --- a/packages/dataviews/src/filters.tsx +++ b/packages/dataviews/src/filters.tsx @@ -29,7 +29,7 @@ const Filters = memo( function Filters< Item extends AnyItem >( { openedFilter, setOpenedFilter, }: FiltersProps< Item > ) { - const addFilterRef = useRef< HTMLButtonElement | null >( null ); + const addFilterRef = useRef< HTMLButtonElement >( null ); const filters: NormalizedFilter[] = []; fields.forEach( ( field ) => { if ( ! field.elements?.length ) { diff --git a/packages/dataviews/src/search-widget.tsx b/packages/dataviews/src/search-widget.tsx index fb679ee31670f9..6a5f4b6644f677 100644 --- a/packages/dataviews/src/search-widget.tsx +++ b/packages/dataviews/src/search-widget.tsx @@ -46,7 +46,7 @@ function normalizeSearchInput( input = '' ) { return removeAccents( input.trim().toLowerCase() ); } -const EMPTY_ARRAY = [] as []; +const EMPTY_ARRAY: [] = []; const getCurrentValue = ( filterDefinition: NormalizedFilter, currentFilter?: Filter