4.3.3 • Published 7 years ago

@simplr/react-forms-validation v4.3.3

Weekly downloads
21
License
AGPL-3.0
Repository
github
Last release
7 years ago

This package subscribes to @simplr/react-forms store and it will validate on emitted actions.

Features

  • Validates fields on form store actions (FieldRegistered, ValueChanged, PropsChanged)
  • Subscribes to form store handler and form stores to listen actions
  • Premade validators like: Email, Required, Contains etc.

Get started

To initialise module you need to import subscriber once in your app.

import { InitializeValidation } from "@simplr/react-forms-validation";

InitializeValidation();

Validators example

import { Form, Text, Password } from "@simplr/react-forms-dom";
import { RequiredValidator, EmailValidator } from "@simplr/react-forms-validation";

export function LoginForm(props: {}) {
        return <Form>
            <Text name="username">
                <RequiredValidator error="Username field is required" />
                <EmailValidator error="Username is not valid" />
            </Text>
            <Password name="password">
                <RequiredValidator error="Password field is required" />
            </Password>
            <button>Submit</button>
        </Form>;
    }
}
4.4.0-alpha.12

7 years ago

4.4.0-alpha.11

7 years ago

4.4.0-alpha.10

7 years ago

4.4.0-alpha.9

7 years ago

4.4.0-alpha.8

7 years ago

4.4.0-alpha.7

7 years ago

4.4.0-alpha.5

7 years ago

4.4.0-alpha.4

7 years ago

4.4.0-alpha.3

7 years ago

4.4.0-alpha.2

7 years ago

4.4.0-alpha

7 years ago

4.3.3

8 years ago

4.3.2

8 years ago

4.3.1

8 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.1.11

8 years ago

4.1.10

8 years ago

4.1.9

8 years ago

4.1.8

8 years ago

4.1.7

8 years ago

4.1.6

8 years ago

4.1.5

8 years ago

4.1.4

8 years ago

4.1.3

8 years ago

4.1.2

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago