You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The other big problem I see in state.py is that substates cannot redefine or override fields from a parent state. Maybe this restriction doesn't make sense anymore... if a substate redefines a field, then it should be a different value than the same-named field in a parent state, but that's just not how the code is written today.
@masenf wdyt about emitting an error/warning first? Overwriting vars could introduce more unexpected behavior and is not trivial to solve. We could add it as a feature later on if we need it
reflex.utils.exceptions.VarNameError: State var "foo" in <class 'repro_overwrite.repro_overwrite.State'> has been shadowed by a substate var; use a different field name instead".
Activity
masenf commentedon Aug 22, 2024
related to [REF-2300]
benedikt-bartscher commentedon Aug 26, 2024
@masenf wdyt about emitting an error/warning first? Overwriting vars could introduce more unexpected behavior and is not trivial to solve. We could add it as a feature later on if we need it
masenf commentedon Aug 26, 2024
i think it already does raise an error right?
benedikt-bartscher commentedon Aug 26, 2024
iirc it only does for base vars, not for computed vars
benedikt-bartscher commentedon Aug 27, 2024
#3843