formula-one
Advanced tools
Comparing version 0.9.3 to 0.9.4
# Changelog | ||
### v0.9.4 | ||
- Bump some dependency versions | ||
### v0.9.3 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "formula-one", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Strongly-typed React form state management", | ||
@@ -5,0 +5,0 @@ "author": "Zach Gotsch", |
@@ -165,4 +165,4 @@ # formula-one | ||
import {FeedbackStrategies} from "formula-one"; | ||
const {Changed, Submitted, or} = FeedbackStrategies; | ||
const myStrategy = or(Changed, Submitted); | ||
const {Changed, Blurred, Submitted, or, and} = FeedbackStrategies; | ||
const strategy = or(and(Changed, Blurred), Submitted); | ||
``` | ||
@@ -534,13 +534,15 @@ | ||
render() { | ||
<div> | ||
<Form | ||
ref={f => { | ||
this.form = f; | ||
}} | ||
onSubmit={handleSubmit} | ||
> | ||
{link => <UserField link={link} />} | ||
</Form> | ||
<button onClick={this.handleSubmitClick}>Submit</button> | ||
</div>; | ||
return ( | ||
<div> | ||
<Form | ||
ref={f => { | ||
this.form = f; | ||
}} | ||
onSubmit={handleSubmit} | ||
> | ||
{link => <UserField link={link} />} | ||
</Form> | ||
<button onClick={this.handleSubmitClick}>Submit</button> | ||
</div> | ||
); | ||
} | ||
@@ -553,1 +555,7 @@ } | ||
<!-- #### Disjoint union --> | ||
## Frequently Asked Questions | ||
### Is it possible to reset a form to a new initial state? | ||
Normally, after the initial render, a `<Form>` component will ignore changes to its `initialState` prop. This is necessary because the `<Form>` component tracks metadata in addition to the any updates to the value of the form, and it must maintain that data as the user edits the form. If you want to start over with a new initial state and count all fields as unchanged and unblurred, you can provide a `key` prop to your `<Form>`. When this `key` changes, React will discard the state of your form and `<Form>` will be initialized with the provided `initialState`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
461459
559
1