React Native uses view configs to translate JavaScript props into values native components can use, such as converting a color name into an integer. Today, it calculates these configs at app startup through native reflection, even for components the app may never use. White says platform differences and separate native, JavaScript, and documentation definitions also create inconsistent sources of truth.
Modernizing React Native’s JavaScript
Speaker
Eli White, a software engineering manager on Facebook’s React Native team, explains JavaScript changes for the new React Native architecture at React Native EU 2020, hosted by Callstack.
White describes Codegen as a system that takes Flow or TypeScript definitions, converts them into a shared schema, and generates native interfaces and JavaScript view configs. This makes JavaScript the single source of truth and puts view configs in the app bundle instead of calculating them at runtime. The generated interfaces keep types consistent across JavaScript and native code, including for native modules.
White says Fabric does not use UIManager, and direct product code calls to it are being deprecated. For measuring a view, he points to the existing `ref.measure` API; for component commands such as `scrollTo` or a map’s `moveToRegion`, Codegen can generate typed methods and matching native interfaces. This replaces untyped command arguments passed in arrays.
`findNodeHandle` searches for the nearest native component behind a JavaScript ref, so a seemingly simple refactor, such as adding or removing a wrapper view, can change what gets measured. White says the search is slow and requires maintaining the React tree. He recommends forwarding refs to the intended native view, then calling methods such as `measure` on that ref; React Native core components in version 0.62 already use `forwardRef`.
White frames the removals as changes to uncommon features, often used in library code, and says the aim is to keep application code working with as few changes as possible. UIManager access and `findNodeHandle` are slated for deprecation, with migration guidance and replacement APIs planned for supported use cases.
Takeaways
- Generate view configs at build time to avoid repeated startup work.
- Use typed Flow or TypeScript specs to keep native interfaces aligned with JavaScript.
- Prefer `ref.measure` and generated typed commands over direct UIManager calls.
- Forward refs to the exact native component an API should operate on.
- Treat `findNodeHandle` as a refactoring risk because its result depends on component structure.
Mentioned in this talk
Search inside this talk
What was claimed 9
- role at
“I'm a software engineering manager on the React Native team at Facebook.”
YouTube Unverified1 source· Talk
- uses
“We're going to solve these problems by changing our view configs ... with automated code generation. We call it Codegen.”
YouTube Unverified1 source· Talk
- featurecode generation: Generates native interfaces and JavaScript view configs from JavaScript type definitions.
“We process those JavaScript types into a shared schema ... then process that schema and generate code in different places.”
YouTube Unverified1 source· Talk
- featureReact Native: Codegen moves view config creation from runtime startup to build time.
“That view config will be part of the bundle at build time instead of being processed and calculated at runtime.”
YouTube Unverified1 source· Talk
- featureReact Native: JavaScript is the single source of truth for component and native module types in the new architecture.
“We have a single source of truth in JavaScript that ensures our whole system is consistent.”
YouTube Unverified1 source· Talk
- featureUIManager: Direct calls from product code are being deprecated.
“Direct calls to the UIManager from product code are going to be deprecated.”
YouTube Unverified1 source· Talk
- featurefindNodeHandle: Will be deprecated in React Native.
“findNodeHandle is going to be deprecated in React Native soon.”
YouTube Unverified1 source· Talk
- metricReact Native: Core components in version 0.62 use forwardRef.
“All of the core components in 0.62 use forwardRef.”
YouTube Unverified1 source· Talk
- usesReact Native uses forwardRef
“All of the core components in 0.62 use forwardRef.”
YouTube Unverified1 source· Talk





