How React Native runs your app · senior
JSI: direct calls between JS and native
JSI is a C++ interface to the JavaScript engine that lets native code expose functions and HostObjects which JS calls directly, even synchronously, with no JSON in between.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- A HostObject is a C++ object that JS sees as a normal object. Reading a property or calling a method goes straight into C++.
- Because calls are direct, a native method can return a value synchronously: const v = Module.getValue(). On the old bridge everything needed a callback or a promise.
- A synchronous call blocks the JS thread until native returns. Keep sync for cheap work (read a setting, an MMKV get). Use promises for disk, network or heavy computation.
- TurboModules, Fabric, Reanimated, MMKV v4 and VisionCamera are all built on JSI. Hermes implements the JSI interface.
- Chrome "Debug JS Remotely" ran your JS inside Chrome on your computer, so synchronous JSI calls could not work. It was removed in 0.79; React Native DevTools debugs the JS running on the device.
- Binary data: 0.86 added JSI TypedArray support, and 0.88 lets Java TurboModules take and return an ArrayBuffer. Borrowed bytes are valid only until the method returns; copy them to keep them.
- JSI does not make your JS multi-threaded. Extra runtimes (Reanimated's UI runtime, camera frame workers) are separate JS runtimes.
The red pen
Common traps: mistake → fix
Mistake: "JSI and TurboModules are the same thing"
Fix: TurboModules are built on top of JSI; JSI is the lower-level C++ API.
Mistake: "Now every native call should be synchronous"
Fix: a slow sync call freezes the JS thread; keep I/O async.
Mistake: "JSI lets my JS run on several threads"
Fix: app JS still runs on one JS thread.
Mistake: "Send big binary data as base64"
Fix: since 0.88 Java TurboModules accept ArrayBuffer; before that use file URIs or C++/JSI modules.
Easy to hard
Questions interviewers ask, easy to hard
- What is JSI in one sentence?
- What is a HostObject?
- Why can a native module now return a value synchronously, and when should it not?
- Why did Chrome remote debugging stop working with JSI libraries like MMKV?
- How would you pass a 5 MB image buffer from JS to native without base64?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.