reflex/integration
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
..
benchmarks [REF-1958] Remove shadowed radix css props (#2590) 2024-02-13 10:06:28 -08:00
init-test [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
__init__.py Client-side storage / State integration (#1629) 2023-08-30 12:43:29 -07:00
conftest.py fix SmartDisplay visible parameter (#2451) 2024-01-24 17:41:16 -08:00
test_background_task.py Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
test_call_script.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_client_storage.py [REF-1988] API to Get instance of Arbitrary State class (#2678) 2024-02-27 13:02:08 -08:00
test_connection_banner.py apps should no longer call "app.compile()" (#2291) 2023-12-18 16:06:21 -08:00
test_dynamic_routes.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_event_actions.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_event_chain.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_form_submit.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_input.py [REF-2101] Support default_value and default_checked on rx.el.input (#2739) 2024-02-27 16:57:37 -08:00
test_large_state.py simple pytest benchmark for measuring event <=> state update round trip time (#2489) 2024-01-30 15:55:55 -08:00
test_login_flow.py Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
test_media.py fix image serializing - REF-1889 (#2550) 2024-02-22 08:13:19 -08:00
test_navigation.py [REF-1993] link: respect is_external prop and other attributes on A tag (#2651) 2024-02-19 15:43:27 -08:00
test_server_side_event.py Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
test_state_inheritance.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_table.py Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
test_tailwind.py Track state usage (#2441) 2024-03-07 14:25:55 -08:00
test_upload.py [REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
test_urls.py initial attempt at writing test for urls (#2689) 2024-02-29 13:45:57 -08:00
test_var_operations.py Make @rx.memo work with state vars passed as props (#2810) 2024-03-13 13:41:17 -07:00
utils.py Client-side storage / State integration (#1629) 2023-08-30 12:43:29 -07:00