-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make @rx.memo work with state vars passed as props (#2810)
* Make @rx.memo work with state vars passed as props Seems like this was a regression from the StatefulComponent refactor, because trying to pass a state Var to a CustomComponent gave undefined, likely due to `_get_vars` not accounting for `self.props` in CustomComponents. With this change, it works. Integration test added to `test_var_operations.py` * Allow CustomComponent props to be Component Avoid calling `.json()` on all Base types because the Var serializer already does that, but this way, more specific types (like Component) can be serialized differently. When the type is Component, attach a VarData with the imports and hooks to when the Var is rendered, it also carries the correct imports/hooks and does not throw frontend errors.
- Loading branch information
Showing
2 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters