Skip to content

Commit

Permalink
fix: deconstruct filter from styles (#2389)
Browse files Browse the repository at this point in the history
# 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).
  • Loading branch information
jakex7 committed Aug 5, 2024
1 parent ae6c492 commit 3ac7914
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/filter-image/FilterImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`, []);

Expand Down

0 comments on commit 3ac7914

Please sign in to comment.