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).
This commit is contained in:
Jakub Grzywacz
2024-08-05 17:08:53 +02:00
committed by GitHub
parent ae6c492458
commit 3ac7914f0e
+1 -1
View File
@@ -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()}`, []);