[PR #7702] fix(tui): move props.ref to onMount #12483

Closed
opened 2026-02-16 18:17:23 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7702

State: closed
Merged: Yes


Fixes: #7633 & possibly #7634

What does this PR do?

Currently there is an issue where forking from the first message of a session causes a fatal crash since
the session route calls r.set(route.initialPrompt) immediately after receiving the ref, but theinput is not valid until the textarea component is ready later on-down in the component hierarchy.

This PR moves the Prompt props.ref logic into the onMount lifecycle component to ensure that the ref is only invoked when the component is fully ready.

How did you verify your code works?

https://github.com/user-attachments/assets/180de7a3-a277-4f3f-953c-4d7931833bb8

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7702 **State:** closed **Merged:** Yes --- Fixes: #7633 & possibly #7634 ### What does this PR do? Currently there is an issue where forking from the first message of a session causes a fatal crash since the session route calls `r.set(route.initialPrompt)` immediately after receiving the ref, but the`input` is not valid until the `textarea` component is ready later on-down in the component hierarchy. This PR moves the `Prompt props.ref` logic into the `onMount` lifecycle component to ensure that the ref is only invoked when the component is fully ready. ### How did you verify your code works? https://github.com/user-attachments/assets/180de7a3-a277-4f3f-953c-4d7931833bb8
yindo added the pull-request label 2026-02-16 18:17:23 -05:00
yindo closed this issue 2026-02-16 18:17:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12483