File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,11 @@ export default class Form extends React.Component {
51
51
this . setState ( { values } ) ;
52
52
}
53
53
54
- renderChildren ( ) {
55
- return React . Children . map ( this . props . children , child => {
54
+ renderChildren ( children ) {
55
+ return React . Children . map ( children , child => {
56
56
if ( ! child || ! child . props ) return child ;
57
+ if ( child . children ) return this . renderChildren ( children ) ;
58
+
57
59
let { values, errors } = this . state ;
58
60
59
61
if ( child . props . name )
@@ -75,11 +77,12 @@ export default class Form extends React.Component {
75
77
onClick : ( ) => this . validate ( child . props . onClick ) ,
76
78
} ) ;
77
79
}
80
+ return child ;
78
81
} ) ;
79
82
}
80
83
81
84
render ( ) {
82
85
let { children, rules, ...props } = this . props ;
83
- return < div { ...props } > { this . renderChildren ( ) } </ div > ;
86
+ return < div { ...props } > { this . renderChildren ( children ) } </ div > ;
84
87
}
85
88
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-validify" ,
3
- "version" : " 0.0.5 " ,
3
+ "version" : " 0.0.6 " ,
4
4
"description" : " Form validation made easy" ,
5
5
"main" : " dist/form.js" ,
6
6
"directories" : {
You can’t perform that action at this time.
0 commit comments