Skip to content

Commit 1da2d9a

Browse files
committed
ignore special props
1 parent 3c59785 commit 1da2d9a

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

reflex/components/tags/tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __iter__(self):
7878
for field in dataclasses.fields(self):
7979
if field.name == "props":
8080
yield "props", self.format_props()
81-
else:
81+
elif field.name != "special_props":
8282
rendered_value = render_prop(getattr(self, field.name))
8383
if rendered_value is not None:
8484
yield field.name, rendered_value

tests/units/components/test_component.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -685,19 +685,16 @@ def test_component_create_unallowed_types(children, test_component):
685685
"name": "Fragment",
686686
"props": [],
687687
"contents": "",
688-
"special_props": [],
689688
"children": [
690689
{
691690
"name": "RadixThemesText",
692691
"props": ['as:"p"'],
693692
"contents": "",
694-
"special_props": [],
695693
"children": [
696694
{
697695
"name": "",
698696
"props": [],
699697
"contents": '"first_text"',
700-
"special_props": [],
701698
"children": [],
702699
"autofocus": False,
703700
}
@@ -722,13 +719,11 @@ def test_component_create_unallowed_types(children, test_component):
722719
"contents": '"first_text"',
723720
"name": "",
724721
"props": [],
725-
"special_props": [],
726722
}
727723
],
728724
"contents": "",
729725
"name": "RadixThemesText",
730726
"props": ['as:"p"'],
731-
"special_props": [],
732727
},
733728
{
734729
"autofocus": False,
@@ -739,19 +734,16 @@ def test_component_create_unallowed_types(children, test_component):
739734
"contents": '"second_text"',
740735
"name": "",
741736
"props": [],
742-
"special_props": [],
743737
}
744738
],
745739
"contents": "",
746740
"name": "RadixThemesText",
747741
"props": ['as:"p"'],
748-
"special_props": [],
749742
},
750743
],
751744
"contents": "",
752745
"name": "Fragment",
753746
"props": [],
754-
"special_props": [],
755747
},
756748
),
757749
(
@@ -768,13 +760,11 @@ def test_component_create_unallowed_types(children, test_component):
768760
"contents": '"first_text"',
769761
"name": "",
770762
"props": [],
771-
"special_props": [],
772763
}
773764
],
774765
"contents": "",
775766
"name": "RadixThemesText",
776767
"props": ['as:"p"'],
777-
"special_props": [],
778768
},
779769
{
780770
"autofocus": False,
@@ -791,31 +781,26 @@ def test_component_create_unallowed_types(children, test_component):
791781
"contents": '"second_text"',
792782
"name": "",
793783
"props": [],
794-
"special_props": [],
795784
}
796785
],
797786
"contents": "",
798787
"name": "RadixThemesText",
799788
"props": ['as:"p"'],
800-
"special_props": [],
801789
}
802790
],
803791
"contents": "",
804792
"name": "Fragment",
805793
"props": [],
806-
"special_props": [],
807794
}
808795
],
809796
"contents": "",
810797
"name": "RadixThemesBox",
811798
"props": [],
812-
"special_props": [],
813799
},
814800
],
815801
"contents": "",
816802
"name": "Fragment",
817803
"props": [],
818-
"special_props": [],
819804
},
820805
),
821806
],

tests/units/components/test_tag.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def test_add_props():
6767
"children": [],
6868
"contents": "",
6969
"props": [],
70-
"special_props": [],
7170
},
7271
),
7372
(
@@ -77,7 +76,6 @@ def test_add_props():
7776
"children": [],
7877
"contents": "",
7978
"props": [],
80-
"special_props": [],
8179
},
8280
),
8381
(
@@ -87,7 +85,6 @@ def test_add_props():
8785
"children": [],
8886
"contents": "hello",
8987
"props": [],
90-
"special_props": [],
9188
},
9289
),
9390
(
@@ -97,7 +94,6 @@ def test_add_props():
9794
"children": [],
9895
"contents": "hello",
9996
"props": [],
100-
"special_props": [],
10197
},
10298
),
10399
(
@@ -107,7 +103,6 @@ def test_add_props():
107103
"children": [],
108104
"contents": "",
109105
"props": ['color:"red"', 'textAlign:"center"'],
110-
"special_props": [],
111106
},
112107
),
113108
(
@@ -121,7 +116,6 @@ def test_add_props():
121116
"children": [],
122117
"contents": "text",
123118
"props": ['color:"red"', 'textAlign:"center"'],
124-
"special_props": [],
125119
},
126120
),
127121
],

0 commit comments

Comments
 (0)