UNPKG

@tarojsx/ui

Version:

We reinvents the UI for Taro3+

17 lines 690 B
import { __rest } from "tslib"; import React from 'react'; import { Form as _Form } from '@tarojs/components'; import { useThrottleCallback } from '@tarojsx/hooks/dist/useThrottleCallback'; export const Form = (props) => { const { submitThrottle, onSubmit } = props, rest = __rest(props, ["submitThrottle", "onSubmit"]); const handleSubmit = useThrottleCallback((e) => { if (!onSubmit) return; const event = e; if (!event.persist) event.persist = () => { }; onSubmit(event); }, submitThrottle); return React.createElement(_Form, Object.assign({}, rest, { onSubmit: handleSubmit })); }; //# sourceMappingURL=Form.js.map