Module 01 Β· The three-layer mental model β Lesson 1 of 1 Β· ~11 min
Sensor β native view β bridge β JS
One vertical slice, three layers
Before any code, hold the whole shape in your head. Data flows up from a sensor to your screen; configuration flows down from your screen to the sensor. You are building one vertical slice through three layers:
- React Native (TypeScript/JSX) β
<DepthScannerView onDepth={β¦} />on a screen, plus a thin TS binding that names the native view. - The Expo Module definition β the
View(...) { Prop, Events }DSL. This is the bridge you author. - The native view + sensor β a real UIKit/Android view hosting ARKit or ARCore, sampling depth.
In an interview, say: "A native module is one vertical slice: props flow down from JS to a native setter, events flow up from the sensor to a JS callback. Everything else is plumbing between those two directions."