fix(radix): drop as_child from radio_cards root and item
Merged
VJ
6d ago+23+23+01234567890123456789-9-9-0123456789
Summary
rx.radio_cards.root and rx.radio_cards.item declared an as_child prop that Radix Themes does not accept:
RadioCards.Rootprops areComponentPropsWithout<typeof RadioGroupPrimitive.Root, 'asChild' | 'color' | 'defaultChecked'>, and the root wraps the primitive in<Grid asChild>. ForwardingasChildturned the primitive into aSlot, so the page crashed with several cards (Primitive.div failed to slot onto its children) or lost its container with one.RadioCards.Itemrenders<RadioGroupPrimitive.Item {...props} asChild={false} />, so the prop did nothing.
This removes the field from both components, the same way #7345 left it off checkbox_cards / checkbox_group. Passing as_child now falls through like any other undeclared prop instead of reaching Radix.
Changes
radio_cards.py: removeas_childfromRadioCardsRootandRadioCardsItem.pyi_hashes.json: regeneratedradio_cards.pyihash.tests/units/reflex_components_radix/themes/components/test_radio_cards.py: regression test that neither component renders anasChildprop.packages/reflex-components-radix/news/7555.bugfix.md: news fragment.
Verification
- New test fails on
main(bothrootanditemrenderasChild:true) and passes with the fix. - Default usage without
as_childrenders unchanged (columns,defaultValue, etc.). uv run pytest tests/units/components tests/units/reflex_components_radix tests/units/compiler: 4594 passed, 1 skipped.ruff check,ruff format --check, andpyrighton the touched files: clean.
Type of change
- Bug fix (non-breaking change which fixes an issue)
Closes #7555