mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #214] Calling remove on a TextNodeRenderable in react throws with "Child not found in children" error #50
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @eli0shin on GitHub (Oct 12, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/214
There is an architectural mismatch in the class hierarchy:
abstract remove(id: string): void- expecting ID-based lookuprenderableMapById.get(id)to look up child by IDSpanRenderableinherits from) implements it incorrectly:remove(child: string | TextNodeRenderable): thisindexOf(child)to find the child - NO ID LOOKUPFor example, this code works:
But this code throws the error because the child of
<text>is conditionalThe solid reconciler passes node reference directly for TextNodeRenderables and passes it to
removebut the react one does not, which raises the question: Why areTextNodeRenderables different than other renderables? Why do they use remove by reference instead of by id?It seems that the correct fix here would be to align
TextNodeRenderables with other renderables so that they use remove by id as well. Alternatively we can add the same lookup by id reference in the react reconciler.