react-hook-form

๐Ÿ“‹ React Hooks for form state management and validation (Web + React Native)

MIT License

Downloads
25.6M
Stars
39.4K
Committers
318

Bot releases are hidden (Show)

react-hook-form - Version 7.32.2

Published by bluebill1049 over 2 years ago

๐Ÿ‹๐Ÿป improve build dist package size (https://github.com/react-hook-form/react-hook-form/pull/8511)
๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/8506 delayError not overwrite existing function call (https://github.com/react-hook-form/react-hook-form/pull/8509)
๐Ÿ“– update the use of validadtionSchema in v7 examples (https://github.com/react-hook-form/react-hook-form/pull/8501)

thanks, @bryantobing12

react-hook-form - Version 7.32.1

Published by bluebill1049 over 2 years ago

๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/8493 error not trigger with delayError (https://github.com/react-hook-form/react-hook-form/pull/8494)
๐Ÿ” fix null or undefined cases caught by TS ^4.8 (https://github.com/react-hook-form/react-hook-form/pull/8487)
๐Ÿฅธ funnel along with appropriate constraints for (upcoming) TypeScript 4.8 (https://github.com/react-hook-form/react-hook-form/pull/8484)

thanks to @DanielRosenwasser

react-hook-form - Version 7.32.0

Published by bluebill1049 over 2 years ago

๐ŸŽ  feat: make UseFormRegisterReturn generic over TFieldName (https://github.com/react-hook-form/react-hook-form/pull/8414)
๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/8459 regression issue with draft state object (https://github.com/react-hook-form/react-hook-form/pull/8463)
๐Ÿงพ fix: doc watch() with callback example must deconstruct the returned type (https://github.com/react-hook-form/react-hook-form/pull/8451)
๐Ÿค fix: compare html elements against correct global (https://github.com/react-hook-form/react-hook-form/pull/8355)
๐Ÿž flush errors state update when user switch input with delayError (#8429)

thanks to @omjadas @Pika-Pool and @zenoamaro

react-hook-form - Version 7.31.3

Published by bluebill1049 over 2 years ago

๐Ÿง‘โ€๐Ÿ’ป Support TypeScript 4.7+ ESM (https://github.com/react-hook-form/react-hook-form/pull/8390)
๐Ÿงพ Fix typo (https://github.com/react-hook-form/react-hook-form/pull/8389)
โ„น๏ธ fix export types order
๐Ÿช upgrade to TS 4.7 (https://github.com/react-hook-form/react-hook-form/pull/8402)
๐Ÿ•ธ close https://github.com/react-hook-form/react-hook-form/issues/8404 use isWeb instead of globalThis (https://github.com/react-hook-form/react-hook-form/pull/8406)
๐Ÿฅฌ save cloneObject bytes (https://github.com/react-hook-form/react-hook-form/pull/8407)

thanks to @davbrito, @rossng, @hwanyoungChoi and @Moshyfawn

react-hook-form - Version 7.31.2

Published by bluebill1049 over 2 years ago

๐Ÿž fix(reset): set isSubmitted to formState value if keepIsSubmitted is true (https://github.com/react-hook-form/react-hook-form/pull/8368)

thanks to @blabute

react-hook-form - Version 7.31.1

Published by bluebill1049 over 2 years ago

๐ŸŽญ close #7472 include a proxy check with field state to improve useController perf (#8334)
๐Ÿž fix #8339 Revert "๐Ÿ—‘ remove the reference for blob and file list (https://github.com/react-hook-form/react-hook-form/pull/8305)"
๐Ÿšฎ remove dead code (#8337)

thanks to @NMinhNguyen

react-hook-form - Version 7.31.0

Published by bluebill1049 over 2 years ago

๐Ÿš€ reset optional prop: keepDirtyValues (https://github.com/react-hook-form/react-hook-form/pull/8237)

reset(
  {
    firstName: "bill", // if firstName is dirty then the value will be retained
    lastName: "luo"
  },
  { keepDirtyValues: true } // keep any changed field
);

๐Ÿ‘ฉโ€๐Ÿ”ง close https://github.com/react-hook-form/react-hook-form/issues/8324 auto-correct field array errors on user action (https://github.com/react-hook-form/react-hook-form/pull/8325)

const { append } = useFieldArray()

append({ data: '' }) // will auto correct existing field array errors if any

๐Ÿž fix: clone objects which have functions (https://github.com/react-hook-form/react-hook-form/pull/8301)
๐Ÿ“– fix name of a new option in 6.12.0 change-log notes (https://github.com/react-hook-form/react-hook-form/pull/8335)

thanks to @Moshyfawn @airman5573 @TkDodo and @MasterOdin

react-hook-form - Version 7.30.0

Published by bluebill1049 over 2 years ago

Notes

๐Ÿฃ determine checkbox group by defaultValues set as array value (https://github.com/react-hook-form/react-hook-form/pull/7938)

useForm({
  defaultValues: {
    checkboxes: [], // register checkbox will be determine as array of checkboxes
  },
});
register('checkboxes'); // will return array as value

๐Ÿงช improve test cases with checkbox default value as array (https://github.com/react-hook-form/react-hook-form/pull/7501)
๐Ÿ“• add fieldState invalid depreciation note (https://github.com/react-hook-form/react-hook-form/pull/8202)
โ›‘ improve getNodeParentName missing case(s) (https://github.com/react-hook-form/react-hook-form/pull/8181)
๐Ÿ”จ support field array parents with numbers in name (https://github.com/react-hook-form/react-hook-form/pull/8167)
๐Ÿ’‰ improve lib tests cases (https://github.com/react-hook-form/react-hook-form/pull/8155)

Contributors

Thanks to contributors below โค๏ธ

  • @spacenate
  • @tedliang
  • @Moshyfawn
  • @jgullstr
  • @romain-trotard
react-hook-form - Version 7.29.0

Published by bluebill1049 over 2 years ago

โค๏ธ update react 18 peer dep
๐Ÿ“ฆ es2017 to es2018 (https://github.com/react-hook-form/react-hook-form/pull/8066) Reduce 1% of package weight
๐Ÿƒ avoid runtime error with compact (https://github.com/react-hook-form/react-hook-form/pull/8094)
๐Ÿ‘‹ goodbye omit (https://github.com/react-hook-form/react-hook-form/pull/8079)
๐Ÿž close https://github.com/react-hook-form/react-hook-form/issues/8071 issue on shouldUnreigster mutate defaultValues (https://github.com/react-hook-form/react-hook-form/pull/8078)
โญ๏ธ close https://github.com/react-hook-form/react-hook-form/issues/8076 isMount flag issue with useEffect running twice with react 18 (https://github.com/react-hook-form/react-hook-form/pull/8077)
๐ŸŽง close https://github.com/react-hook-form/react-hook-form/issues/8071 clean up at useForm useEffect (https://github.com/react-hook-form/react-hook-form/pull/8073)

react-hook-form - Version 7.28.1

Published by bluebill1049 over 2 years ago

๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/8050 disabled attribute ignored with register checkbox (https://github.com/react-hook-form/react-hook-form/pull/8053)
๐Ÿ“ฆ update package.json to set sideEffect false (https://github.com/react-hook-form/react-hook-form/pull/8041)
๐Ÿ†™ TS 4.6.0 (https://github.com/react-hook-form/react-hook-form/pull/7623)
๐Ÿ“– fix replace API TSDoc for fieldArray

thanks to @alexogar and @Moshyfawn

react-hook-form - Version 7.28.0

Published by bluebill1049 over 2 years ago

๐Ÿฌ enable deps with string syntax (https://github.com/react-hook-form/react-hook-form/pull/7901)

register('test', { deps: 'theOtherInput' })
register('test', { deps: ['theOtherInput', 'others'] })

๐Ÿงท fix field array update to avoid external mutation
๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/7960 issue on unset deeply nested array field (https://github.com/react-hook-form/react-hook-form/pull/7961)
๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/7958 issue with checkbox plus portal (https://github.com/react-hook-form/react-hook-form/pull/7959)
๐Ÿ“ฆ unpack blob data type (https://github.com/react-hook-form/react-hook-form/pull/7937)

thanks to @DASPRiD and @Moshyfawn

react-hook-form - Version 7.28.0-next.0

Published by bluebill1049 over 2 years ago

๐Ÿฌ enable deps with string syntax (https://github.com/react-hook-form/react-hook-form/pull/7901)

register('test', { deps: 'theOtherInput' })

๐Ÿงท fix field array update to avoid external mutation

react-hook-form - Version 7.27.1

Published by bluebill1049 over 2 years ago

react-hook-form - Version 7.27.0

Published by bluebill1049 over 2 years ago

โœจ https://github.com/react-hook-form/react-hook-form/issues/7138 feature: allow selecting input's content on focus (https://github.com/react-hook-form/react-hook-form/pull/7781)

setFocus('fieldName', { shouldSelect: true })

https://user-images.githubusercontent.com/10513364/153570934-ca29337f-d7ce-4744-b282-6939c2e17b48.mp4

โŒจ๏ธ fix https://github.com/react-hook-form/react-hook-form/issues/7772 type issue by using UnpackNestedValue on FieldArray methods (https://github.com/react-hook-form/react-hook-form/pull/7773)

thanks to @Moshyfawn and @hpersson

react-hook-form - Version 7.26.1

Published by bluebill1049 over 2 years ago

๐Ÿž close https://github.com/react-hook-form/react-hook-form/issues/7758 useController should subscribe to exact field name (https://github.com/react-hook-form/react-hook-form/pull/7759)

thanks to @Moshyfawn

react-hook-form - Version 7.26.0

Published by bluebill1049 over 2 years ago

react-hook-form - Version 7.25.3

Published by bluebill1049 over 2 years ago

๐Ÿ˜ญ close #7686 regression on replace API and cloneObject on payload (#7687)

react-hook-form - Version 7.25.2

Published by bluebill1049 over 2 years ago

โš›๏ธ close #7683 support preact with onTouched mode (#7684)

thanks to @Moshyfawn

react-hook-form - Version 7.25.1

Published by bluebill1049 over 2 years ago

๐Ÿž fix #7662 issue with reset file input (#7656)
๐Ÿš— improve perf with get proxy formState (#7655)
๐Ÿ‹๏ธ remove redundant check (#7651)
๐Ÿž fix #7648 Unable to setFocus to Controller after reset (#7649)
๐Ÿž fix: getFieldState - error might be undefined (#7636)
โ›‘ improve useFieldArray code consistency (#7628)

thanks to @Moshyfawn and @michalbundyra

react-hook-form - Version 7.25.0

Published by bluebill1049 over 2 years ago

โœจ new getFieldState API: get individual field state

Documentation: https://react-hook-form.com/api/useform/getfieldstate

import * as React from "react";
import { useForm } from "react-hook-form";

export default function App() {
  const {
    register,
    getFieldState,
    formState: { isDirty, isValid }
  } = useForm({
    mode: "onChange",
    defaultValues: {
      firstName: ""
    }
  });

  // you can invoke before render or within the render function
  const fieldState = getFieldState("firstName");

  return (
    <form>
      <input {...register("firstName", { required: true })} />
      <p>{getFieldState("firstName").isDirty && "dirty"}</p>
      <p>{getFieldState("firstName").isTouched && "touched"}</p>
      <button type="button" onClick={() => console.log(getFieldState("firstName"))}>
        field state
      </button>
    </form>
  );
}