Skip to content

How to implement stateful, reusable components? #2592

Answered by masenf
thevicchij asked this question in Q&A
Discussion options

You must be logged in to vote

This is a possible use case, but reflex currently does not support it very well.

A potential option is to have is_visible as a dict mapping some id to the bool value. Then each modal created by the decorator can generate an id and use it to index into the dict (and event handlers) to control the state for that particular modal.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@TimChild
Comment options

@picklelo
Comment options

@TimChild
Comment options

Answer selected by thevicchij
Comment options

You must be logged in to vote
0 replies
Comment options

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