On a device, some component state lives in native views, not in React. Jest has no native views, so RNTL keeps this state itself in src/events/native-state.ts.
TextInputvalue (valueForInstance): the text in an uncontrolledTextInput. Without it, the input would show no text afteruser.type().ScrollViewcontent offset (contentOffsetForInstance): the current scroll position. Without it, everyscrollTo()would start from0, 0.- Layout size (
layoutSizeForInstance): an element's width and height from the lastlayoutevent. Scroll events use it as theScrollView's defaultlayoutMeasurement.
- Writes.
fireEventanduserEventupdate native state when they simulate a change that a native view would make.fireEventdoes it throughupdateNativeStateFromEvent()insrc/events/update-native-state.ts. EachuserEventaction writes it directly. - Reads. Helpers read native state, like
getTextInputValue()insrc/helpers/text-input.ts. Queries and matchers use those helpers instead of reading native state directly. - Props win. A controlled prop (like
value) always takes precedence over native state. - No reset. State is stored in
WeakMaps keyed by host instance. It disappears when the instance is unmounted, socleanup()doesn't need to clear it. - Internal. Native state isn't part of the public API.