ソースを参照

Fix aria-* and other hiphenated props in `jsx` mode

Masen Furer 2 ヶ月 前
コミット
589a2a46fd
1 ファイル変更9 行追加2 行削除
  1. 9 2
      reflex/utils/format.py

+ 9 - 2
reflex/utils/format.py

@@ -436,8 +436,15 @@ def format_props(*single_props, **key_value_props) -> list[str]:
     from reflex.vars.base import LiteralVar, Var
 
     return [
-        (
-            f"{name}:{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}"
+        ":".join(
+            [
+                str(name if "-" not in name else LiteralVar.create(name)),
+                str(
+                    format_prop(
+                        prop if isinstance(prop, Var) else LiteralVar.create(prop)
+                    )
+                ),
+            ]
         )
         for name, prop in sorted(key_value_props.items())
         if prop is not None