Closed dyanechi closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 60.44%. Comparing base (
5d46d5e
) to head (0127771
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Allows to use
SubmitEvent
type explicitly in closures to fix error when submitting form withon:submit
.Currently the following code:
Will cause error:
Defining function with empty closure
let submit_fn = move|_| {...}
infers toimpl Fn(SubmitEvent)
but you can't calle.prevent_default()
that prevents page refresh on submitting forms.Unless there's better way to do it (like implementing, this simple re-export of
SubmitEvent
fixes the problem by allowing explicit type definition. This refactored function now compiles and works as expected: