mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-05 22:56:11 +00:00
chore: Remove legacy version check in react-native.config.js (#2503)
## Description Removes legacy version check from `react-native.config.js`. ## Changes The community CLI is no longer a dependency for React Native, meaning it may not be installed in every project. For example, projects that use Expo won't include the `@react-native-community/cli-*` packages. Consequently, this check will fail, leading to issues with autolinking components. This version check can be removed safely, as the 9th version of the CLI was released two years ago. ## Tests This change was tested using `expo` project on react native `0.76`. Co-authored-by: Jakub Grzywacz <jakub.grzywacz@swmansion.com>
This commit is contained in:
@@ -1,52 +1,40 @@
|
|||||||
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 = {
|
module.exports = {
|
||||||
dependency: {
|
dependency: {
|
||||||
platforms: {
|
platforms: {
|
||||||
android: supportsCodegenConfig
|
android: {
|
||||||
? {
|
componentDescriptors: [
|
||||||
componentDescriptors: [
|
'RNSVGCircleComponentDescriptor',
|
||||||
'RNSVGCircleComponentDescriptor',
|
'RNSVGClipPathComponentDescriptor',
|
||||||
'RNSVGClipPathComponentDescriptor',
|
'RNSVGDefsComponentDescriptor',
|
||||||
'RNSVGDefsComponentDescriptor',
|
'RNSVGFeBlendComponentDescriptor',
|
||||||
'RNSVGFeBlendComponentDescriptor',
|
'RNSVGFeColorMatrixComponentDescriptor',
|
||||||
'RNSVGFeColorMatrixComponentDescriptor',
|
'RNSVGFeCompositeComponentDescriptor',
|
||||||
'RNSVGFeCompositeComponentDescriptor',
|
'RNSVGFeFloodComponentDescriptor',
|
||||||
'RNSVGFeFloodComponentDescriptor',
|
'RNSVGFeGaussianBlurComponentDescriptor',
|
||||||
'RNSVGFeGaussianBlurComponentDescriptor',
|
'RNSVGFeMergeComponentDescriptor',
|
||||||
'RNSVGFeMergeComponentDescriptor',
|
'RNSVGFeOffsetComponentDescriptor',
|
||||||
'RNSVGFeOffsetComponentDescriptor',
|
'RNSVGFilterComponentDescriptor',
|
||||||
'RNSVGFilterComponentDescriptor',
|
'RNSVGEllipseComponentDescriptor',
|
||||||
'RNSVGEllipseComponentDescriptor',
|
'RNSVGForeignObjectComponentDescriptor',
|
||||||
'RNSVGForeignObjectComponentDescriptor',
|
'RNSVGGroupComponentDescriptor',
|
||||||
'RNSVGGroupComponentDescriptor',
|
'RNSVGImageComponentDescriptor',
|
||||||
'RNSVGImageComponentDescriptor',
|
'RNSVGLinearGradientComponentDescriptor',
|
||||||
'RNSVGLinearGradientComponentDescriptor',
|
'RNSVGLineComponentDescriptor',
|
||||||
'RNSVGLineComponentDescriptor',
|
'RNSVGMarkerComponentDescriptor',
|
||||||
'RNSVGMarkerComponentDescriptor',
|
'RNSVGMaskComponentDescriptor',
|
||||||
'RNSVGMaskComponentDescriptor',
|
'RNSVGPathComponentDescriptor',
|
||||||
'RNSVGPathComponentDescriptor',
|
'RNSVGPatternComponentDescriptor',
|
||||||
'RNSVGPatternComponentDescriptor',
|
'RNSVGRadialGradientComponentDescriptor',
|
||||||
'RNSVGRadialGradientComponentDescriptor',
|
'RNSVGRectComponentDescriptor',
|
||||||
'RNSVGRectComponentDescriptor',
|
'RNSVGSvgViewAndroidComponentDescriptor',
|
||||||
'RNSVGSvgViewAndroidComponentDescriptor',
|
'RNSVGSymbolComponentDescriptor',
|
||||||
'RNSVGSymbolComponentDescriptor',
|
'RNSVGTextComponentDescriptor',
|
||||||
'RNSVGTextComponentDescriptor',
|
'RNSVGTextPathComponentDescriptor',
|
||||||
'RNSVGTextPathComponentDescriptor',
|
'RNSVGTSpanComponentDescriptor',
|
||||||
'RNSVGTSpanComponentDescriptor',
|
'RNSVGUseComponentDescriptor',
|
||||||
'RNSVGUseComponentDescriptor',
|
],
|
||||||
],
|
cmakeListsPath: '../android/src/main/jni/CMakeLists.txt',
|
||||||
cmakeListsPath: '../android/src/main/jni/CMakeLists.txt',
|
},
|
||||||
}
|
|
||||||
: {},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user