How to get onSubmit to work? Need this for `react-...
# react
n
How to get onSubmit to work? Need this for
react-hook-form
wrapper
Copy code
form {
    attrs.onSubmitFunction = {
        console.log("Submit")
    }
    attrs.onSubmit = {
        console.log("Submit")
    }

    input(classes = defaultButtonStyle, type = InputType.submit) {
    }
}
Tried it with intput of type submit and with button of type submit, both refresh the page and nothing gets logged in the console. (Prevent default for button did work for preventing the refresh but it didn't log anything)
t
1. Use
attrs.onSubmit
only 2. Use
preventDefault()
(details)
👍 1