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
"TypeError: Invalid var passed for prop value, expected type <class 'str'>, got value _["reps"] of type typing.Any."
When using a state variable which returns a dictionary of mixed types. Given that the required type annotations only really allow a single type annotation for dictionaries. Dict[str, str] for example being a dictionary where the keys and values are all strings.
To Reproduce
Create a state variable which returns a dictionary with mixed types and provide the type annotation Dict[str, Any].
Create a form which requires both text elements and numeric inputs.
Try to use the state variable's values to set the initial values for the form.
Page should render with NumberInputs where they should be in the form.
Screenshots
If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
Python Version: 3.11
Reflex Version: 2.0.9
OS: Ubuntu 22.04.03 LTS
Browser (Optional): Chrome
Additional context
I am working around the issue by using regular inputs, and casting the numeric values to strings, then will be casting them back to numeric values before writing to the database.
The text was updated successfully, but these errors were encountered:
Describe the bug
NumberInput (number_input) gives an error:
"TypeError: Invalid var passed for prop value, expected type <class 'str'>, got value _["reps"] of type typing.Any."
When using a state variable which returns a dictionary of mixed types. Given that the required type annotations only really allow a single type annotation for dictionaries. Dict[str, str] for example being a dictionary where the keys and values are all strings.
To Reproduce
Create a state variable which returns a dictionary with mixed types and provide the type annotation Dict[str, Any].
Create a form which requires both text elements and numeric inputs.
Try to use the state variable's values to set the initial values for the form.
Expected behavior
Page should render with NumberInputs where they should be in the form.
Screenshots
If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
Additional context
I am working around the issue by using regular inputs, and casting the numeric values to strings, then will be casting them back to numeric values before writing to the database.
The text was updated successfully, but these errors were encountered: