New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

form-hooks

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-hooks - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0-alpha.0

2

package.json
{
"name": "form-hooks",
"version": "0.4.0",
"version": "0.5.0-alpha.0",
"description": "Easy forms in React with hooks",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -60,3 +60,3 @@ # form-hooks

### `useForm<Values>(options: FormHookOptions): FormHookState<Values>` - `FormHookOptions`
### `useForm<Values>(options: FormHookOptions, dependencies?: FormHookDependencies<Values>): FormHookState<Values>` - `FormHookOptions`

@@ -92,3 +92,3 @@ The `useForm` hook takes some options (as an object) to initialize state

### `useForm<Values>(options: FormHookOptions): FormHookState<Values>` - `FormHookState`
### `useForm<Values>(options: FormHookOptions, dependencies?: FormHookDependencies<Values>): FormHookState<Values>` - `FormHookState`

@@ -136,2 +136,20 @@ #### `errors: FormHookErrors<Values>`

### `FormHookDependencies<Values>` - Form Reinitialization
The second parameter to `useForm` allows for a list of dependencies to be
declared from the collection of options passed through in the first argument. For instance in this example:
```ts
useForm(
{
initialValues: { first: 'John', last: 'Doe' },
onSubmit: () => {},
validate: () => ({}),
},
options => [options.initialValues]
);
```
Changing the `initialValues` object will cause the Form to be re-initialized. `initialValues`, `errors`, `touched`, `submitCount` and `isSubmitting` will be reset.
[formik]: https://github.com/jaredpalmer/formik
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