Skip to main content
.onSubmit(action: () => void): Component;

Parameters

action
() => void
The action to perform when the user submits a value.

Support

Usage

Text field submission

const [name, setName] = useState("")

TextField({ placeholder: "Enter your name", text: name, setText: setName })
    .onSubmit(() => {
        console.log("Name submitted:", name);
    })