![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Formyl is a library meant to be used with React that saves the state of forms and also offers custom validation
npm install formyl
smartForm(object, ReactComponent)
import {smartForm} from "formyl"
class Form extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<form onSubmit={this.props.onSubmit}>
<input
value={this.props.values.name}
name="name"
onChange={this.props.onChange}
type="text"
/>
<input
value={this.props.values.email}
name="email"
onChange={this.props.onChange}
type="text"
/>
<button type="submit">Submit</button>
</form>
<h1>{!this.props.errors.name ? "VALID" : this.props.errors.name}</h1>
<h1>
{!this.props.errors.email
? "VALID"
: this.props.errors.email.map(e => e)}
</h1>
</div>
);
}
}
// returns smartForm
smartForm(
{
handleSubmit: values => console.log(values),
handleChange: values => console.log(values),
validate: values => {
const errors = {};
if (values.name.length < 5) {
errors.name = "MUST BE AT LEAST 5 CHARS";
}
if (values.email.indexOf("@") === -1) {
errors.email = ["EMAIL needs @symbol"];
}
return errors;
},
initialValues: { name: "", email: "abc@yahoo.com" }
},
Form
);
https://codepen.io/anon/pen/ZwmpzN?editors=1010
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
FAQs
smart form for react
The npm package formyl receives a total of 1 weekly downloads. As such, formyl popularity was classified as not popular.
We found that formyl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.