
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@surinderlohat/lohat-from-validation
Advanced tools
Lohat Form validation is a tool for easy form validations based on the react hooks and reactive programing.
Lohat Form validation is a tool for easy form validations based on the react hooks and reactive programing.
npm install @surinderlohat/lohat-from-validation
yarn add @surinderlohat/lohat-from-validation
Method | PARAMS | RETURN VALUE |
---|---|---|
onSubmit | No | Return from values and error state |
errorMessages | No | Display all errors from the fields |
resetToDefault | No | Reset form state to default All fields will be reset to the default state |
getField | fieldKey | used to get the specific field from the form |
Note: we can get any specific field using form.getField('userName') --all methods are available like: form.getField('userName').hasChanges
Method | TYPE | RETURN VALUE |
---|---|---|
hasChanges | Getter | Return field state i.e it's changed or not |
hasError | Getter | Return error state of the specific field |
errorMessage | Getter | Return error message for current field |
setValue | Function | Set value of specific field |
import { FieldObject, useLohatForm } from '@surinderlohat/lohat-from-validation';
const field: FieldObject = {
userName: {
label: 'UserName',
value: '123',
rules: {
required: true,
regExp: /^[0-9]+$/,
min: 2,
max: 10,
},
},
email: {
label: 'Email',
value: 'abc@gmail.com',
},
};
function FormValidation() {
const form = useLohatForm(field);
return (
<div className="App">
<form>
<FormField field={form.getField('userName')} />
<FormField field={form.getField('email')} />
</form>
</div>
);
}
function FormField({ field }: Props) {
return (
<div>
<label>{field.label}</label>
<input {...field.bind()}></input>
<p> errorMessage{'' + field.errorMessage}</p>
</div>
);
}
https://codesandbox.io/embed/sleepy-napier-ci2lg
MIT Free Software!
FAQs
Lohat Form validation is a tool for easy form validations based on the react hooks and reactive programing.
The npm package @surinderlohat/lohat-from-validation receives a total of 0 weekly downloads. As such, @surinderlohat/lohat-from-validation popularity was classified as not popular.
We found that @surinderlohat/lohat-from-validation 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.