Skip to content

Commit 711e9ea

Browse files
fix: prevent example app from adding newArchEnabled if already present (#796)
### Summary 👋 Hey! I was creating a new library and noticed that the generated `example/android/gradle.properties` file had the `newArchEnabled=true` setting duplicated. I think it has to do with the vanilla example app now setting the flag to true by default ([@react-native-community/cli](https://github.com/react-native-community/cli)), but I can't point to a specific commit or dependency that causes it 🤷‍♂️. In any case, the change should be safe even if they revert it so there's that. ### Test plan - Create a new library with a vanilla example app and make sure the generated `example/android/gradle.properties` file has no duplicated `newArchEnabled=true` lines.
1 parent 8ff17fc commit 711e9ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/create-react-native-library/src/exampleApp/generateExampleApp.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ export default async function generateExampleApp({
290290
'newArchEnabled=false',
291291
'newArchEnabled=true'
292292
);
293-
} else {
293+
} else if (
294+
!gradleProperties.split('\n').includes('newArchEnabled=true')
295+
) {
294296
gradleProperties += '\nnewArchEnabled=true';
295297
}
296298
}

0 commit comments

Comments
 (0)