Преглед на файлове

[ENG-3817] deprecate _var_name_unwrapped (instead of removing it) (#3951)

some components and code examples used `_var_name_unwrapped`, so map this
property back to `_js_expr` and deprecate it.
Masen Furer преди 8 месеца
родител
ревизия
5f296eec38
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      reflex/vars/base.py

+ 10 - 0
reflex/vars/base.py

@@ -119,6 +119,16 @@ class Var(Generic[VAR_TYPE]):
         """
         return self._js_expr
 
+    @property
+    @deprecated("Use `_js_expr` instead.")
+    def _var_name_unwrapped(self) -> str:
+        """The name of the var without extra curly braces.
+
+        Returns:
+            The name of the var.
+        """
+        return self._js_expr
+
     @property
     def _var_is_string(self) -> bool:
         """Whether the var is a string literal.