Skip to content

Commit f6d9f1c

Browse files
authored
Update Readme.md
1 parent df5bcdc commit f6d9f1c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,41 @@ npm install react-material-ui-form-validator
1818

1919
Implementation of [react-form-validator-core](https://www.npmjs.com/package/react-form-validator-core) for [material-ui](https://material-ui.com/)
2020

21+
### Migration guide
22+
23+
#### From <2.1.1 to >=2.1.1
24+
25+
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`.
26+
27+
Before:
28+
````javascript
29+
import React from 'react';
30+
import { ValidatorComponent } from 'react-material-ui-form-validator';
31+
32+
class SomeValidator extends ValidatorComponent {
33+
render() {
34+
// return your validated component
35+
}
36+
}
37+
38+
export default TextValidator;
39+
````
40+
41+
After:
42+
````javascript
43+
import React from 'react';
44+
import { ValidatorComponent } from 'react-material-ui-form-validator';
45+
46+
class SomeValidator extends ValidatorComponent {
47+
renderValidatorComponent() {
48+
// return your validated component
49+
}
50+
}
51+
52+
export default TextValidator;
53+
````
54+
### Info
55+
2156
Supported types:
2257
+ Text ([TextValidator](https://github.com/NewOldMax/react-material-ui-form-validator/blob/master/src/TextValidator.jsx))
2358
+ Select ([SelectValidator](https://github.com/NewOldMax/react-material-ui-form-validator/blob/master/src/SelectValidator.jsx))

0 commit comments

Comments
 (0)