File tree Expand file tree Collapse file tree 4 files changed +33
-26
lines changed Expand file tree Collapse file tree 4 files changed +33
-26
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-reactive-form" ,
3- "version" : " 1.0.12 " ,
3+ "version" : " 1.0.13 " ,
44 "description" : " Angular like Reactive Forms in React" ,
55 "keywords" : [
66 " forms" ,
Original file line number Diff line number Diff line change @@ -16,13 +16,12 @@ class FieldArray extends React.Component {
1616 }
1717 render ( ) {
1818 const { strict, children, render } = this . props
19- return (
20- < Field
21- control = { this . control }
22- strict = { strict }
23- render = { render || children || null }
24- />
25- )
19+ const FieldProps = {
20+ control : this . control ,
21+ strict,
22+ render : render || children || null
23+ }
24+ return React . createElement ( Field , FieldProps )
2625 }
2726}
2827FieldArray . childContextTypes = {
Original file line number Diff line number Diff line change 11import React from 'react'
22import PropTypes from 'prop-types'
3- import { FormControl , FormArray , FormGroup } from './model'
3+ import {
4+ FormControl ,
5+ FormArray ,
6+ FormGroup
7+ } from './model'
48import configureControl from './configureControl'
59import Field from './Field'
610
@@ -10,20 +14,25 @@ export default class FieldControl extends React.Component {
1014 this . control = configureControl ( props , context , 'FormControl' )
1115 }
1216 componentWillReceiveProps ( nextProps ) {
13- const { name } = nextProps
17+ const {
18+ name
19+ } = nextProps
1420 if ( this . props . name !== name ) {
1521 this . control = configureControl ( nextProps , this . context , 'FormControl' )
1622 }
1723 }
1824 render ( ) {
19- const { strict, children, render } = this . props
20- return (
21- < Field
22- control = { this . control }
23- strict = { strict }
24- render = { render || children || null }
25- />
26- )
25+ const {
26+ strict,
27+ children,
28+ render
29+ } = this . props
30+ const FieldProps = {
31+ control : this . control ,
32+ strict,
33+ render : render || children || null
34+ }
35+ return React . createElement ( Field , FieldProps )
2736 }
2837}
2938
@@ -65,4 +74,4 @@ FieldControl.contextTypes = {
6574 PropTypes . instanceOf ( FormArray ) ,
6675 PropTypes . instanceOf ( FormGroup )
6776 ] )
68- }
77+ }
Original file line number Diff line number Diff line change @@ -16,13 +16,12 @@ class FieldGroup extends React.Component {
1616 }
1717 render ( ) {
1818 const { strict, children, render } = this . props
19- return (
20- < Field
21- control = { this . control }
22- strict = { strict }
23- render = { render || children || null }
24- />
25- )
19+ const FieldProps = {
20+ control : this . control ,
21+ strict,
22+ render : render || children || null
23+ }
24+ return React . createElement ( Field , FieldProps )
2625 }
2726}
2827
You can’t perform that action at this time.
0 commit comments