|
@@ -1013,6 +1013,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|
Raises:
|
|
Raises:
|
|
VarTypeError: if the variable has an incorrect type
|
|
VarTypeError: if the variable has an incorrect type
|
|
"""
|
|
"""
|
|
|
|
+ from reflex.config import get_config
|
|
from reflex.utils.exceptions import VarTypeError
|
|
from reflex.utils.exceptions import VarTypeError
|
|
|
|
|
|
if not types.is_valid_var_type(prop._var_type):
|
|
if not types.is_valid_var_type(prop._var_type):
|
|
@@ -1023,7 +1024,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|
f'Found var "{prop._js_expr}" with type {prop._var_type}.'
|
|
f'Found var "{prop._js_expr}" with type {prop._var_type}.'
|
|
)
|
|
)
|
|
cls._set_var(prop)
|
|
cls._set_var(prop)
|
|
- cls._create_setter(prop)
|
|
|
|
|
|
+ if get_config().state_auto_setters:
|
|
|
|
+ cls._create_setter(prop)
|
|
cls._set_default_value(prop)
|
|
cls._set_default_value(prop)
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|