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
With var_name="is-open", that produces invalid JavaScript along the lines of:
const[is-open,setIs-open]=useState(false)
The same problem applies to names containing spaces, punctuation, or reserved JavaScript words.
Expected behavior
Reflex should not generate invalid JavaScript from an accepted ClientStateVar name.
Possible fixes:
Validate var_name as a safe JavaScript identifier and raise a clear ValueError for invalid names.
Or generate a safe internal hook identifier and keep the user-provided name only for stable ref keys.
Actual behavior
Invalid names are accepted by ClientStateVar.create(), then used directly in hook declarations and setter names, causing generated frontend code to fail.
Area
Frontend/client-state runtime.
Duplicate check
I searched existing issues and PRs for ClientStateVar with invalid identifiers, hyphenated names, client_state var_name, and generated setIs-open output, and did not find an existing report for this behavior.
Activity
linear-code commentedon Aug 1, 2026
ENG-10753