fix(tui): move props.ref to onMount
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
The following comment was made by an LLM, it may be inaccurate:
No duplicate PRs found
@rekram1-node This is the PR for the code I was talking about earlier
/review
lgtm