Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

onSubmit for form in antd

// no more onSubmit, use onFinish
import "./styles.css";
import { Form, Button } from "antd";
export default function App() {
  const hello = () => {
    console.log("enter");
  };

  return (
    <div className="App">
      <Form onFinish={hello}>
        <Form.Item>
          <Button type="primary" htmlType="submit">
            Apply
          </Button>
        </Form.Item>
      </Form>
    </div>
  );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #onSubmit #form #antd
ADD COMMENT
Topic
Name
9+8 =