def _set_default_value(cls, prop: Var):
        """Set the default value for the var.

        Args:
            prop: The var to set the default value for.
        """
        # Get the pydantic field for the var.
        field = cls.get_fields()[prop._var_field_name]

        if field.default is None and not types.is_optional(prop._var_type):
            # Ensure frontend uses null coalescing when accessing.
            object.__setattr__(prop, "_var_type", prop._var_type | None)
Set the default value for the var.

        Args:
            prop: The var to set the default value for.
        
reflex/state.py