Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF-2879] rx._x.client_state: set property does not allow setting a specific value #3348

Closed
masenf opened this issue May 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working Hosting Bug Created by Linear-GitHub Sync
Milestone

Comments

@masenf
Copy link
Collaborator

masenf commented May 20, 2024

Describe the bug
With .push you can supply the value to set the client side state var. With .set it only gives back an EventChain type var that can get the value from the event trigger, but cannot be used to set the var to an explicit value.

To Reproduce

ClientState = rx._x.client_state("CS", True)

rx.button("False", on_click=ClientState.set(False))

Expected behavior
Expect to be able to set the client state var by passing a value directly, but since set is a property that returns a BaseVar, it's not callable and doesn't actually work

Specifics (please complete the following information):

  • Python Version: 3.11
  • Reflex Version: 0.5.1a2
  • OS:
  • Browser (Optional):

REF-2879

@masenf masenf added the bug Something isn't working label May 20, 2024
@masenf masenf changed the title rx._x.client_state: set property does not allow setting a specific value [REF-2879] rx._x.client_state: set property does not allow setting a specific value May 20, 2024
@masenf masenf added the Hosting Bug Created by Linear-GitHub Sync label May 20, 2024
@masenf
Copy link
Collaborator Author

masenf commented May 21, 2024

Additional issues:

Does not seem to work in an rx.memo component; maybe passing hooks in _var_data doesn't work in a memo component?

Even outside of an rx.memo it doesn't seem to work in a markdown component.

@masenf masenf self-assigned this May 23, 2024
@masenf masenf modified the milestones: v.35, v.36 May 23, 2024
@masenf masenf modified the milestones: v.36, v.37 Jun 2, 2024
@masenf masenf closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hosting Bug Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant