Continuous Native Generation

Also called CNG, Prebuild, Config plugin

Also known as
CNG, Prebuild, Config plugin
Mentioned in
Expo
Updated

What is Continuous Native Generation in React Native?

Continuous Native Generation (CNG) regenerates the ios and android folders from app config and config plugins, so native projects are build artefacts rather than hand-edited source.

ios54android54sdk 54app.json
The freshly generated ios/ and android/Config plugins in app.jsonPlugin changes stamped into bothThe magazine holds blanks cut from the Expo SDK native template. The ram is app.json, and every die bar in it is a config plugin. npx expo prebuild --clean scraps the current ios/ and android/, feeds a fresh blank pair under the ram and stamps every plugin into both. The same app.json always stamps the same folders, so a shim screwed on by hand is gone after the next run: put that change in a config plugin. Upgrading the SDK swaps the blanks, and the same dies stamp the new template, with nothing to merge.

Continuous Native Generation is the practice of treating the ios/ and android/ directories as generated output rather than source you maintain. Running npx expo prebuild recreates them from app.json plus a set of config plugins.

Without CNG, adding a library that needs a permission means editing Info.plist and AndroidManifest.xml by hand — and then resolving conflicts in those files on every React Native upgrade. With CNG you declare the intent once:

{
  "plugins": [["expo-camera", { "cameraPermission": "Scan receipts" }]]
}

A config plugin is the function that applies one library's native changes during prebuild. Most Expo SDK packages ship one; community libraries increasingly do too.

The payoff is upgrades. Because the native folders are regenerated, bumping React Native does not mean merging someone else's changes into your Podfile.

You can still drop out and manage native folders manually — the "bare" approach — but you lose that upgrade property. See prebuild.