React Native 运行 JavaScript 和 native 代码,它们必须通信。原始架构使用异步 bridge;新架构(JSI、TurboModules、Fabric)启用了更快的同步通信。理解这一点可以澄清 React Native 的行为和性能。
原始架构:bridge
React Native runs:
→ a JS THREAD (your React/JS code) and the NATIVE side (UI, native modules)
→ they communicate over a BRIDGE: messages are SERIALIZED (to JSON), passed ASYNC,
and deserialized on the other side
Limitations:
✗ ASYNCHRONOUS only (can't call native synchronously)
✗ SERIALIZATION overhead; the bridge can be a BOTTLENECK with heavy traffic
✗ e.g. fast scrolling/animations passing data over the bridge → jank
