Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hook-form

Package Overview
Dependencies
Maintainers
1
Versions
1032
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hook-form - npm Package Versions

1
104

7.43.3

Diff

bluebill1049
published 7.43.2 •

bluebill1049
published 7.44.0-next.1 •

bluebill1049
published 7.44.0-next.0 •

bluebill1049
published 7.43.1 •

bluebill1049
published 7.43.0 •

Changelog

Source

[7.43.0] - 2023-01-30

Added

  • support global error type
const onSubmit = async () => {
  setError('root.serverError', {
    type: response.statusCode,
  });
};
const onClick = () => {
  setError('root.random', {
    type: 'random',
  });
};

return (
  <>
    {errors.root.serverError.type === 400 && <p>server response message</p>}
    <p>{errors.root?.random?.message}</p>
  </>
);
bluebill1049
published 7.43.0-next.0 •

bluebill1049
published 7.42.1 •

bluebill1049
published 7.42.0 •

Changelog

Source

[7.42.0] - 2023-01-13

Added

  • build in validation validate support second argument for form values
// Making exported validate function isolated for validation
export function validateNumber(_: number, formValus: FormValues) {
  return formValus.number1 + formValus.number2 === 3;
}

<input
  type="number"
  {...register('number1', {
    validate: validateNumber,
    valueAsNumber: true,
  })}
/>;

Changed

  • handleSubmit no longer catch onSubmit callback error
  • Remove deprecated for fieldState.invalid
bluebill1049
published 7.41.5 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc