@formeum/core
v0.1.5
Published
[](https://badge.fury.io/js/@formeum%2Fcore) [](https://www.gnu.org/licenses/gpl-3.0) [;The return value now contains all the typed form hooks and components. These can be used to render and handle the form:
import { myForm } from './myForm.ts';
export const MyComponent = () => (
<myForm.FormHandler initialValues={{ myField: "" }} onSubmit={() => Promise.resolve()}>
<label>
First name
<myForm.FormHTMLInput name="myField">
{props => <input {...props} />}
</myForm.FormHTMLInput>
</label>
<myForm.FormCallback>
{({ submitForm }) => (
<button onClick={() => submitForm()}>Submit</button>
)}
</myForm.FormCallback>
</myForm.FormHandler>
);This is a basic example, but Formeum exports many different hooks and components which use each other internally, meaning you can extract different bits of logic you need and use the library in a way which suits you. It is recommended to look at the full JSDocs to see these. You can also see and play with many examples in the storybook documentation.
