Skip to content
Discussion options

You must be logged in to vote

Hey @wansidqi — thanks for the clear repro. You've hit a real gap in Perry's UI reactivity, not a bug in your code.

What's happening

The problematic line is:

Text(`current state for text: ${text.value}`)

text.value is read once at construction time (returns "") and the resulting string is baked into the Text widget. Subsequent text.set(...) calls update the state cell, and your stateBindTextfield(text, field) correctly two-way-binds the input — but the standalone Text does not re-render, because nothing subscribed it to the state cell.

Internally, Perry's runtime already has a perry_ui_state_bind_text_template primitive for exactly this use case, but the compile-time pass that auto-rewrites

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wansidqi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants