Skip to content

Commit 81f6029

Browse files
authored
chore: Remove legacy version check in react-native.config.js (#2432)
## 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. ## Test code and steps to reproduce This change was tested using `expo` project on react native `0.76`.
1 parent 414b5ed commit 81f6029

1 file changed

Lines changed: 16 additions & 28 deletions

File tree

react-native.config.js

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
1-
let supportsCodegenConfig = false;
2-
try {
3-
const rnCliAndroidVersion =
4-
require('@react-native-community/cli-platform-android/package.json').version;
5-
const [major] = rnCliAndroidVersion.split('.');
6-
supportsCodegenConfig = major >= 9;
7-
} catch (e) {
8-
// ignore
9-
}
10-
111
module.exports = {
122
dependency: {
133
platforms: {
14-
android: supportsCodegenConfig
15-
? {
16-
componentDescriptors: [
17-
"RNSFullWindowOverlayComponentDescriptor",
18-
"RNSScreenContainerComponentDescriptor",
19-
"RNSScreenNavigationContainerComponentDescriptor",
20-
"RNSScreenStackHeaderConfigComponentDescriptor",
21-
"RNSScreenStackHeaderSubviewComponentDescriptor",
22-
"RNSScreenStackComponentDescriptor",
23-
"RNSSearchBarComponentDescriptor",
24-
'RNSScreenComponentDescriptor',
25-
"RNSScreenFooterComponentDescriptor",
26-
"RNSScreenContentWrapperComponentDescriptor",
27-
'RNSModalScreenComponentDescriptor'
28-
],
29-
cmakeListsPath: "../android/src/main/jni/CMakeLists.txt"
30-
}
31-
: {},
4+
android: {
5+
componentDescriptors: [
6+
"RNSFullWindowOverlayComponentDescriptor",
7+
"RNSScreenContainerComponentDescriptor",
8+
"RNSScreenNavigationContainerComponentDescriptor",
9+
"RNSScreenStackHeaderConfigComponentDescriptor",
10+
"RNSScreenStackHeaderSubviewComponentDescriptor",
11+
"RNSScreenStackComponentDescriptor",
12+
"RNSSearchBarComponentDescriptor",
13+
'RNSScreenComponentDescriptor',
14+
"RNSScreenFooterComponentDescriptor",
15+
"RNSScreenContentWrapperComponentDescriptor",
16+
'RNSModalScreenComponentDescriptor'
17+
],
18+
cmakeListsPath: "../android/src/main/jni/CMakeLists.txt"
19+
},
3220
},
3321
},
3422
};

0 commit comments

Comments
 (0)