@@ -432,12 +432,19 @@ export function setContainerScroll(
432432 containerScrolls.set(props, scroll);
433433 }
434434
435-const textInputCursors = new WeakMap<TextInputProps, number>();
436-const textInputScrolls = new WeakMap<TextInputProps, number>();
435+/**
436+ * TextInput state is keyed on the `onChange` function reference, which is
437+ * a stable identity across re-renders (the app provides the same closure).
438+ * This avoids losing cursor/scroll position when props objects are recreated
439+ * each frame.
440+ */
441+type OnChangeFn = (value: string) => void;
442+const textInputCursors = new WeakMap<OnChangeFn, number>();
443+const textInputScrolls = new WeakMap<OnChangeFn, number>();
437444
438445 /** Get the cursor offset for a TextInput (framework-managed). */
439446 export function getTextInputCursor(props: TextInputProps): number {
440- return textInputCursors.get(props) ?? props.value.length;
447+ return textInputCursors.get(props.onChange) ?? props.value.length;
441448 }
442449
443450 /** Set the cursor offset for a TextInput. */
@@ -445,12 +452,12 @@ export function setTextInputCursor(
445452 props: TextInputProps,
446453 cursor: number,
447454 ): void {
448- textInputCursors.set(props, cursor);
455+ textInputCursors.set(props.onChange, cursor);
449456 }
450457
451458 /** Get the scroll offset for a TextInput (framework-managed). */
452459 export function getTextInputScroll(props: TextInputProps): number {
453- return textInputScrolls.get(props) ?? 0;
460+ return textInputScrolls.get(props.onChange) ?? 0;
454461 }
455462
456463 /** Set the scroll offset for a TextInput. */
@@ -458,7 +465,7 @@ export function setTextInputScroll(
458465 props: TextInputProps,
459466 scroll: number,
460467 ): void {
461- textInputScrolls.set(props, scroll);
468+ textInputScrolls.set(props.onChange, scroll);
462469 }
463470
464471 /**