mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-22 19:01:36 +00:00
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:
@@ -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()}`, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user