createform

The ReactJS form library

MIT License

Downloads
329
Stars
186
Committers
9

Bot releases are visible (Hide)

createform - v4.0.0 Latest Release

Published by jucian0 over 1 year ago

New release v4.0.0 πŸš€ πŸš€ πŸ₯³

Features

loadData

The loadData feature allows you to retrieve form values from an external API and set them as the initial values of a form.

Example usage:

const useLoginForm = createForm<Form>({
  initialValues: {
    email: "",
  },
  mode: "onSubmit",
  loadData: async (id)=> {
    try {
      return await getFormValues();
    } catch (e) {
      return {};
    }
  },
});

onSubmit

TheonSubmit feature enables you to submit a form.

Example usage:

const useLoginForm = createForm<Form>({
  initialValues: {
    email: "",
  },
  mode: "onSubmit",
  onSubmit: values =>{
    // post or update
}
});

Please note that the above code is just an example, and you may need to adapt it to your specific use case.

createform - V3.5.0

Published by jucian0 over 1 year ago

New release v3.5.0 πŸš€ πŸš€

Feature

useForm() - This hook enables the seamless creation of forms in a native and intuitive manner.

  const { register, errors, getErrors, setFieldValue, getValues } = useForm({
    initialValues: data,
    onSubmit,
 });

  function onSubmit(e: typeof data) {
    console.log(e);
  }

  return (
      <form {...register()}>
          <Input name="name" />
         <button>Submit</button>
         <button typw="reset">Reset</button>
     </form>
}
createform - v3.4.0

Published by jucian0 over 1 year ago

v3.4.0 πŸš€ πŸš€ πŸŽ‰

Feature

  • Add formReset function.
createform - v3.3.25

Published by jucian0 over 1 year ago

New release v3.3.25 πŸš€ πŸš€

3.3.25 (2023-05-01)

Bug Fixes

  • createform: fix register params types (a4dd3d4)
  • types: adding typed field name for register, setField error ,value,touched functions (6e8d923)
  • types: adding typed field name for register, setField error ,value,touched functions (e62fe4f)
createform - v3.3.7

Published by jucian0 over 1 year ago

New release v3.3.7 πŸš€ πŸš€

3.3.7 (2023-03-31)

Bug Fixes

  • createform: fixing undefined value displaying in the input (29ec68e)
  • createform: update yup version, and fix Validate to work with yup v1 (d0873dd)
createform - v3.3.3

Published by jucian0 over 1 year ago

3.3.3

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

Fix

  • Fix useSyncExternalStore integration for server rendering.
createform - V3.3.1

Published by jucian0 over 1 year ago

3.3.0

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

What's Changed

  • Update internal JSDoc to improve DX.
  • From useform to Createform

New feature

  • Add inline validation.
<input
  {...register({
    type: 'email',
    name: 'email',
    validate: yup.string().email().required(), //or zod
  })}
/>
createform - V3.2.4

Published by jucian0 over 1 year ago

3.2.4

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

What's Changed

  • Update internal approach to emit event when update the form state.
  • Add handleReset method, working in the same way of handleSubmit.
  • Replace useEffect, and useState to useSyncExternalStore to update the form state.
createform - 3.1.0

Published by jucian0 about 2 years ago

V3.1.0

React updated to 18.0.2
React DOM updated to 18.0.2

createform - v3.0.0

Published by jucian0 over 2 years ago

3.0.0 (2022-01-23)

Features

  • createform: new function to create a form (289df80)
  • debounce: add a debounce function (bbd5a63)
  • exception: add new exception handle (b8fe654)
  • fieldutild: add functions to deal with fields and their references (f07080a)
  • hooks: remove old implementation (e049371)
  • objectutils: dot-prop implementation (a1ad34a)
  • package.json: remove unused packages (da2c669)
  • store: add Store to keep the form state (7f17381)
  • types: add new types (63b5de2)
  • types: add new types to new implementation (49c9c76)
  • utils: remove old implementation (788a910)
  • validate: add Validate function to deal with errors (ccf09fd)
  • wrapper: wrapper component allow to use custom fields (16f46ee)

Tests

BREAKING CHANGES

  • wrapper: Wrapper is the new way to register a custom component
  • createform: Changes the way to create a form
  • tests: This change introduce createForm function, this function is the new way to create
    forms.
createform - v2.0.5

Published by jucian0 almost 3 years ago

2.0.5 (2022-01-02)

Bug Fixes

  • useform: fix radio button (3f0f20b)
createform - v2.0.4

Published by jucian0 almost 3 years ago

2.0.4 (2021-12-08)

Bug Fixes

  • useform: fix bug when using onSubmit mode (1d00f9c)
createform - v2.0.3

Published by jucian0 almost 3 years ago

2.0.3 (2021-12-07)

Bug Fixes

  • dot-prop: fix error in get function (27a9d11)
  • dot-prop: fix get function (0a945a5)
createform - v2.0.2

Published by jucian0 almost 3 years ago

2.0.2 (2021-11-22)

Bug Fixes

  • useform: fix bug when set input value at funtion setRefValue (b767613)
createform - v2.0.1

Published by jucian0 almost 3 years ago

2.0.1 (2021-11-03)

Bug Fixes

  • remove unused dependencies (626d1ef)
createform - v2.0.0

Published by jucian0 almost 3 years ago

2.0.0 (2021-11-02)

Code Refactoring

  • useform: refectory useForm hook (e6c560f)

Features

  • useForm add handleChange function.

BREAKING CHANGES

  • useform: Remove isControlled and debounced options, and add mode option
createform - v1.2.0

Published by jucian0 over 3 years ago

1.2.0 (2021-07-14)

Bug Fixes

  • types: added deep object types (6e5ee87)

Features

  • types: add object-path-immutable type (c09be86)
  • types: remove advanced types (d57f76a)
createform - v1.1.0

Published by jucian0 over 3 years ago

1.1.0 (2021-06-29)

Bug Fixes

  • usefom: added throw erro when doesnt have a valid ref object (33f53cd), closes #13

Features

  • useform: replace dot-prop-immutable to object-path-immutable (3db379c)
  • yarn.lock: remove yarn lock (2dc8366)
createform - v1.0.9

Published by jucian0 over 3 years ago

1.0.9 (2021-05-07)

Bug Fixes

  • types: fix Touched and Errors types (a86d3e6)
  • types: improviments useForm types (9b80661)
createform - v1.0.4

Published by jucian0 over 4 years ago

Add Support React Native

Package Rankings
Top 6.91% on Npmjs.org
Badges
Extracted from project README
All Contributors GitHub license GitHub coverage Tweet npm-version npm bundle size GitHub Repo stars Stargazers repo roster for createform
Related Projects