fixed issue with hypens ()

This commit is contained in:
wassaf shahzad 2024-01-26 23:14:46 +01:00 committed by GitHub
parent aad009e5df
commit 069892d8ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions
reflex/components/tags
tests/components

View File

@ -64,7 +64,7 @@ class Tag(Base):
"""
self.props.update(
{
format.to_camel_case(name): prop
format.to_camel_case(name, allow_hyphens=True): prop
if types._isinstance(prop, Union[EventChain, dict])
else Var.create(prop)
for name, prop in kwargs.items()

View File

@ -10,6 +10,7 @@ from reflex.vars import BaseVar, Var
"props,test_props",
[
({}, []),
({"key-hypen": 1}, ["key-hypen={1}"]),
({"key": 1}, ["key={1}"]),
({"key": "value"}, ["key={`value`}"]),
({"key": True, "key2": "value2"}, ["key={true}", "key2={`value2`}"]),