Uploaded January 2026 | Updated September 2026, 13 hours ago
Some native values never change, and TurboModules give you a dedicated, type-safe way to expose them to JavaScript. In this episode, Oskar Kwaśniewski shows how to add constants to a Swift TurboModule with full end-to-end type safety using React Native Codegen.
Starting from the TypeScript spec, Oskar explains why `getConstants` is treated differently by Codegen and how it generates strongly typed native interfaces. He then walks through exposing a Swift constant to Objective-C, implementing the required native methods, and comparing this approach with returning untyped dictionaries. The episode wraps up by accessing the constants from JavaScript and highlighting a caching optimization used in React Native’s own modules.
GitHub repo 🖥️ github.com/okwasniewski/swift-turbomodules
Follow Callstack on X 🐦 https://x.com/callstackio
Some native values never change, and TurboModules give you a dedicated, type-safe way to expose them to JavaScript. In this episode, Oskar Kwaśniewski shows how to add constants to a Swift TurboModule with full end-to-end type safety using React Native Codegen.
Starting from the TypeScript spec, Oskar explains why `getConstants` is treated differently by Codegen and how it generates strongly typed native interfaces. He then walks through exposing a Swift constant to Objective-C, implementing the required native methods, and comparing this approach with returning untyped dictionaries. The episode wraps up by accessing the constants from JavaScript and highlighting a caching optimization used in React Native’s own modules.
GitHub repo 🖥️ github.com/okwasniewski/swift-turbomodules
Follow Callstack on X 🐦 https://x.com/callstackio










