UNPKG

@compositive/components-controls

Version:

Compositive component library including form controls.

15 lines (12 loc) 493 B
import { jsx } from 'react/jsx-runtime'; import { View } from '@compositive/foundation'; import { createContext, useContext } from 'react'; const FormContext = createContext({}); const useForm = () => useContext(FormContext); const Form = ({ children, onSubmit, }) => { return (jsx(View, { as: "form", // @ts-expect-error FIXME: the onSubmit field is web-specific onSubmit: onSubmit, children: children })); }; export { Form, useForm }; //# sourceMappingURL=Form.js.map