Skip to content

Commit e2479e3

Browse files
author
bietkul
committed
Fixed compilation issues with jsx
1 parent 205167f commit e2479e3

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

src/FieldArray.jsx renamed to src/FieldArray.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff 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
}
2827
FieldArray.childContextTypes = {

src/FieldControl.jsx renamed to src/FieldControl.js

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import { FormControl, FormArray, FormGroup } from './model'
3+
import {
4+
FormControl,
5+
FormArray,
6+
FormGroup
7+
} from './model'
48
import configureControl from './configureControl'
59
import 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+
}

src/FieldGroup.jsx renamed to src/FieldGroup.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)