Horje
yup react Code Example
yup only characters regex validation react
yup.string()
   .required("Please enter the required field")
   .matches(/^[aA-zZ\s]+$/, "Only alphabets are allowed for this field ")
yup react
npm install -S yup
yup npm
npm i yup --save
yup oneOf
// mixed.oneOf(arrayOfValues: Array<any>, message?: string | function): Schema Alias: equals
// Whitelist a set of values. Values added are automatically removed from any blacklist if they are in it. The ${values} interpolation can be used in the message argument.

// Note that undefined does not fail this validator, even when undefined is not included in arrayOfValues. If you don't want undefined to be a valid value, you can use mixed.required.

let schema = yup.mixed().oneOf(['jimmy', 42]);

await schema.isValid(42); // => true
await schema.isValid('jimmy'); // => true
await schema.isValid(new Date()); // => false
Source: github.com




Shell

Related
linux kill all python processes Code Example linux kill all python processes Code Example
scss in gatsby Code Example scss in gatsby Code Example
git host key verification failed Code Example git host key verification failed Code Example
clear cache manjaro Code Example clear cache manjaro Code Example
streamlink save file Code Example streamlink save file Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11