浏览代码

make _ as not js

Khaleel Al-Adhami 2 天之前
父节点
当前提交
37d82725b5
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      reflex/components/component.py

+ 4 - 2
reflex/components/component.py

@@ -260,13 +260,15 @@ class BaseComponentMeta(ABCMeta):
 
 
             if value is MISSING:
             if value is MISSING:
                 value = ComponentField(
                 value = ComponentField(
-                    default=None, is_javascript=True, annotated_type=annotation
+                    default=None,
+                    is_javascript=(key[0] != "_"),
+                    annotated_type=annotation,
                 )
                 )
             elif not isinstance(value, ComponentField):
             elif not isinstance(value, ComponentField):
                 value = ComponentField(
                 value = ComponentField(
                     default=value,
                     default=value,
                     is_javascript=(
                     is_javascript=(
-                        True
+                        (key[0] != "_")
                         if (existing_field := inherited_fields.get(key)) is None
                         if (existing_field := inherited_fields.get(key)) is None
                         else existing_field.is_javascript
                         else existing_field.is_javascript
                     ),
                     ),