README
Validation component for material-ui forms
Demo
Installation
npm install react-material-ui-form-validator
Versions
- 0.x, 1.x - supports material-ui <= 0.x
- ^2.0.0 - supports material-ui >= 1.x || 3.x || 4.x
- ^3.0.0 - supports material-ui >= 5.x
Implementation of react-form-validator-core for material-ui
Migration guide
From <2.1.1 to >=2.1.1
Breaking changes was introduced to react-form-validator-core in order to avoid legacy context. If you have custom validator components then you should change render
method of your input components to renderValidatorComponent
.
Before:
import React from 'react';
import { ValidatorComponent } from 'react-material-ui-form-validator';
class SomeValidator extends ValidatorComponent {
render() {
// return your validated component
}
}
export default TextValidator;
After:
import React from 'react';
import { ValidatorComponent } from 'react-material-ui-form-validator';
class SomeValidator extends ValidatorComponent {
renderValidatorComponent() {
// return your validated component
}
}
export default TextValidator;
Info
Supported types:
- Text (TextValidator)
- Select (SelectValidator)
Some rules can accept extra parameter, example:
<TextValidator
{...someProps}
validators={['minNumber:0', 'maxNumber:255', 'matchRegexp:^[0-9]