fix: FeMerge on paper (#2384)

# Summary

Use empty string (`""`) instead of `undefined` for previous filter
result in `FeMergeNode`
This commit is contained in:
Jakub Grzywacz
2024-07-31 15:13:50 +02:00
committed by GitHub
parent b8b022c31e
commit 7acbee41f3
4 changed files with 7 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ interface FilterPrimitiveCommonProps {
}
export interface NativeProps extends ViewProps, FilterPrimitiveCommonProps {
nodes?: ReadonlyArray<UnsafeMixed<string | undefined>>;
nodes?: ReadonlyArray<string>;
}
export default codegenNativeComponent<NativeProps>('RNSVGFeMerge');

View File

@@ -95,7 +95,7 @@ export const extractFeMerge = (
props: FeMergeComponentProps,
parent: unknown
): FeMergeNativeProps => {
const nodes: Array<string | undefined> = [];
const nodes: Array<string> = [];
const childArray = props.children
? React.Children.map(props.children, (child) =>
React.cloneElement(child, { parent })
@@ -106,7 +106,7 @@ export const extractFeMerge = (
const {
props: { in: in1 },
} = childArray[i];
nodes.push(in1);
nodes.push(in1 || '');
}
return { nodes };