reflex/reflex/components
Masen Furer 036afa951a
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.
2024-03-13 13:41:17 -07:00
..
base Track state usage (#2441) 2024-03-07 14:25:55 -08:00
chakra [REF-1368] Move common form functionality to rx.el.forms (#2801) 2024-03-07 13:17:54 -08:00
core [REF-2157] Allow rx.download to resolve rx.get_upload_url links (#2813) 2024-03-11 12:29:34 -07:00
datadisplay [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
el Track state usage (#2441) 2024-03-07 14:25:55 -08:00
gridjs [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
lucide [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
markdown Unwrap images in rx.markdown (#2789) 2024-03-06 16:03:33 -08:00
media Refactor chakra components into separate folder (#2315) 2023-12-21 09:52:08 -08:00
moment [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
next [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
plotly Add config to rx.plotly component (#2745) 2024-02-28 12:44:33 -08:00
radix Remove width prop from rx.select (#2835) 2024-03-13 12:32:12 -07:00
react_player [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
recharts [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
suneditor [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
tags Drawer component styles should only be in css dict (#2640) 2024-02-16 09:41:02 -08:00
__init__.py Use rx.el.img as rx.image (#2558) 2024-02-08 14:44:53 -08:00
component.py Make @rx.memo work with state vars passed as props (#2810) 2024-03-13 13:41:17 -07:00
literals.py Chakra input component type_ prop literal (#2292) 2023-12-18 15:43:51 -08:00