mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
# Summary As mentioned in #2362 Introduce new filters: * `FeMerge` * `FeMergeNode` ## Example usage ```tsx <Svg width="200" height="200"> <Filter id="mergeWithOffset" width="180" height="180"> <FeOffset dx="50" dy="50" result="test" /> <FeOffset dx="100" dy="100" in="SourceGraphic" /> <FeMerge> <FeMergeNode in="SourceGraphic" /> <FeMergeNode in="test" /> <FeMergeNode /> </FeMerge> </Filter> <Rect x="0" y="0" width="100" height="100" stroke="black" fill="red" filter="url(#mergeWithOffset)" /> </Svg> ``` <img width="207" alt="image" src="https://github.com/user-attachments/assets/9cb3ded6-f939-4b2b-8ece-df54e64fe898"> ## Test Plan `Example` app -> `Filters` -> `FeMerge` ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ | ## Checklist - [x] I have tested this on a device and a simulator - [x] I added documentation in `README.md` - [x] I updated the typed files (typescript)
50 lines
1.8 KiB
JavaScript
50 lines
1.8 KiB
JavaScript
let supportsCodegenConfig = false;
|
|
try {
|
|
const rnCliAndroidVersion =
|
|
require('@react-native-community/cli-platform-android/package.json').version;
|
|
const [major] = rnCliAndroidVersion.split('.');
|
|
supportsCodegenConfig = major >= 9;
|
|
} catch (e) {
|
|
// ignore
|
|
}
|
|
|
|
module.exports = {
|
|
dependency: {
|
|
platforms: {
|
|
android: supportsCodegenConfig
|
|
? {
|
|
componentDescriptors: [
|
|
'RNSVGCircleComponentDescriptor',
|
|
'RNSVGClipPathComponentDescriptor',
|
|
'RNSVGDefsComponentDescriptor',
|
|
'RNSVGFeColorMatrixComponentDescriptor',
|
|
'RNSVGFeGaussianBlurComponentDescriptor',
|
|
'RNSVGFeMergeComponentDescriptor',
|
|
'RNSVGFeOffsetComponentDescriptor',
|
|
'RNSVGFilterComponentDescriptor',
|
|
'RNSVGEllipseComponentDescriptor',
|
|
'RNSVGForeignObjectComponentDescriptor',
|
|
'RNSVGGroupComponentDescriptor',
|
|
'RNSVGImageComponentDescriptor',
|
|
'RNSVGLinearGradientComponentDescriptor',
|
|
'RNSVGLineComponentDescriptor',
|
|
'RNSVGMarkerComponentDescriptor',
|
|
'RNSVGMaskComponentDescriptor',
|
|
'RNSVGPathComponentDescriptor',
|
|
'RNSVGPatternComponentDescriptor',
|
|
'RNSVGRadialGradientComponentDescriptor',
|
|
'RNSVGRectComponentDescriptor',
|
|
'RNSVGSvgViewAndroidComponentDescriptor',
|
|
'RNSVGSymbolComponentDescriptor',
|
|
'RNSVGTextComponentDescriptor',
|
|
'RNSVGTextPathComponentDescriptor',
|
|
'RNSVGTSpanComponentDescriptor',
|
|
'RNSVGUseComponentDescriptor',
|
|
],
|
|
cmakeListsPath: '../android/src/main/jni/CMakeLists.txt',
|
|
}
|
|
: {},
|
|
},
|
|
},
|
|
};
|