Skip to content

Commit acc14e5

Browse files
author
bietkul
committed
Added isStatic option in $field_ control
1 parent c79a7a9 commit acc14e5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/FormGenerator.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ export default class FormGenerator extends React.Component {
4747
(typeof configProps.index === 'string' &&
4848
configProps.index.startsWith(FIELD_CONFIG_STRING))
4949
) {
50-
return React.createElement(
51-
Field,
52-
Object.assign({}, { control: this.form }, propsToBePassed)
53-
)
50+
// Only subscribe when isStatic is false
51+
if (configProps.isStatic === false) {
52+
return React.createElement(
53+
Field,
54+
Object.assign({}, { control: this.form }, propsToBePassed)
55+
)
56+
}
57+
return propsToBePassed.render()
5458
}
5559

5660
if (configProps.controls) {

0 commit comments

Comments
 (0)