How the heck does reflex update state when it is used in a component's f string? #2120
guidocalvano
announced in
Q&A
Replies: 2 comments
-
When using f-strings we override the Line 278 in 6e71393 So basically if you do something like <Text>
{`${state.text} formatted`}
</Text> So basically the frontend references the state variable, so whenever it gets updated the template string will update too. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Pretty kewl, can't argue with that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It isn't really a bug or anything, but I am just so curious how you made that happen, and I figured, I can always ask...
How the heck does reflex update state when it is used in a component's f string?
Am I correct in the following assertions?: Whenever you use a member of a rx.State it calls a function that stores its use, while it returns a template variable denoting string. The next component that is created is now associated with that State's member. Whenever the state is updated the template string is replaced with the State's member value.
This is the best I could come up with. So far your library seems awesome by the way.
Beta Was this translation helpful? Give feedback.
All reactions