From 3ac7914f0eb4f31913b733930a0d41bfc1baba43 Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Mon, 5 Aug 2024 17:08:53 +0200 Subject: [PATCH] fix: deconstruct filter from styles (#2389) # Summary Somehow deconstructing `filter` from `styles` are throwing error, when filter does not exist. These changes ensure that `filter` is always there (`[]` if not exists). --- src/filter-image/FilterImage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filter-image/FilterImage.tsx b/src/filter-image/FilterImage.tsx index dfb4f111..17b7a7fb 100644 --- a/src/filter-image/FilterImage.tsx +++ b/src/filter-image/FilterImage.tsx @@ -25,7 +25,7 @@ export interface FilterImageProps extends ImageProps { export const FilterImage = (props: FilterImageProps) => { const { filters = [], source, style, ...imageProps } = props; - const { filter: stylesFilter, ...styles } = StyleSheet.flatten(style); + const { filter: stylesFilter, ...styles } = StyleSheet.flatten(style ?? {}); const extractedFilters = [...filters, ...extractFiltersCss(stylesFilter)]; const filterId = React.useMemo(() => `RNSVG-${getRandomNumber()}`, []);