Interview frequency: …
Short answer
CNG programmatically generates clean android and ios directories, which can be deleted and regenerated when needed, using app.json and Config Plugins instead of manually editing native files.
Explanation
React Native developers previously had to edit AppDelegate, AndroidManifest, and Gradle files manually, making React Native upgrades difficult and conflict-prone. With CNG, native directories are build artifacts that can be deleted and recreated cleanly with npx expo prebuild.
Code example
// app.config.ts — the single source of truth; ios/ and android/ are generated from it
import type { ExpoConfig } from "expo/config";
export default (): ExpoConfig => ({
name: "MyApp",
slug: "my-app",
ios: { bundleIdentifier: "com.example.myapp" },
android: { package: "com.example.myapp" },
plugins: ["expo-camera", ["expo-build-properties", { android: { minSdkVersion: 26 } }]],
});
// Generate (or cleanly regenerate) the native projects:
// npx expo prebuild --clean
// ios/ and android/ can be git-ignored and deleted at any time.Common mistakes
- Manually editing native code inside the android or ios directories without recording the changes in a Config Plugin, causing them to be erased during prebuild.
Follow-up questions
- What are Expo Config Plugins, and how do they safely modify native code and libraries?
- What is the difference between the bare React Native CLI workflow and the Expo Managed Workflow?