Clicking "Click me!" or "Click me optionally!" results in a deprecation warning.
DeprecationWarning: mismatched-type-assignment has been deprecated in version 0.6.5 Tried to assign value Hello, Reflex! of type <class 'str'> to field State.string_var of type reflex.vars.base.Field. This might lead to unexpected behavior. It will be completely removed in 0.7.0
I guess the type resolution should be done as in state.py::get_var_for_field(), where there is a branch depending on if it is an rx.Field.
Since I don't know what plans are for the check when 0.7.0 comes, I cannot come up with a fix right now.
Describe the bug
Clicking "Click me!" or "Click me optionally!" results in a deprecation warning.
DeprecationWarning: mismatched-type-assignment has been deprecated in version 0.6.5 Tried to assign value Hello, Reflex! of type <class 'str'> to field State.string_var of type reflex.vars.base.Field. This might lead to unexpected behavior. It will be completely removed in 0.7.0
I guess the type resolution should be done as in
state.py::get_var_for_field()
, where there is a branch depending on if it is anrx.Field
. Since I don't know what plans are for the check when 0.7.0 comes, I cannot come up with a fix right now.Printing the resulting
ModelField.type_
for all inget_fields()
as in the code above yields:Maybe a
get_field_type()
method should be added or an reflex-own subclass ofModelField
should be used wheretype_
already performs the resolution.