Skip to content

Commit

Permalink
chore: Remove legacy version check in react-native.config.js (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmccall authored Oct 31, 2024
1 parent e8f873f commit 03a2872
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
let supportsCodegenConfig = true;
try {
const rnCliAndroidVersion = require.main.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
? {
libraryName: 'safeareacontext',
componentDescriptors: [
'RNCSafeAreaProviderComponentDescriptor',
'RNCSafeAreaViewComponentDescriptor',
],
cmakeListsPath: 'src/main/jni/CMakeLists.txt',
}
: {},
android: {
libraryName: 'safeareacontext',
componentDescriptors: [
'RNCSafeAreaProviderComponentDescriptor',
'RNCSafeAreaViewComponentDescriptor',
],
cmakeListsPath: 'src/main/jni/CMakeLists.txt',
},
macos: null,
windows: null,
},
Expand Down

0 comments on commit 03a2872

Please sign in to comment.