Releases: eversport/pyro-form
Going functional
Migration to functional component
This release was about making pyro-form simpler and better to reason with than before. It also allows for better manageable adding of features going onwards. This still is handled as a breaking change since while being on it we decided to drop some of the exposed values/callbacks to further simplify the API.
If there is a need for them to have a comeback we are open to that.
Improve Render Child Props
Expose handleChange
function in child render props to allow easy setting of different/multiple form fields.
Simpler Minimal Forms
With this release a new Form
component is exposed which takes the current context's handleSubmit function an uses it on itself. Also passing in a render-as-a-child function to PyroForm is now optional. So a now working minimal form looks like this:
export const BasicExample = () => (
<PyroForm initialValues={initialValues} onSubmit={onSubmit}>
<Form>
<HookInput<InitialValues> name="name" type="text" />
<button type="submit">Submit</button>
</Form>
</PyroForm>
)
React Hooks Support
- Update all dependencies
- Create
usePyroField
hook to simplify PyroField creation - Update examples
Improve onChange handler
Features
- Pass changed value into onChange callback together with a generic onChange function: Closes #5
Chore
- Update typescript version
- Remove unnecessary ts-ignores
- Update examples
- Export typings for the onChange and for the onSubmit handler
First stable release
Over the last months pyro-form has been battle tested at Eversports and with the last minimal changes we now feel comfortable to publish a first major release. We will respect the principles of semver on this repo so don't be (too) afraid of code changes an patch/minor releases.
I hope you love pyro-form as much as we do!