Skip to content

Commit 9dc8033

Browse files
author
bietkul
committed
Added props support in custom components
1 parent 402d948 commit 9dc8033

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/formBuilder/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,15 @@ export default class FormBuilder extends Component {
216216
updateValue: this.onValueChange,
217217
};
218218
if (customComponents) {
219-
const CustomComponent = customComponents[field.type];
220-
if (CustomComponent) {
219+
const CustomComponentObj = customComponents[field.type];
220+
if (CustomComponentObj) {
221+
const CustomComponent = CustomComponentObj.component;
222+
const CustomComponentProps = CustomComponentObj.props;
221223
return (
222224
<CustomComponent
223225
ref={(c) => { this[field.name] = c; }}
224226
{... commonProps}
227+
{...CustomComponentProps}
225228
onSummitTextInput={this.onSummitTextInput}
226229
/>
227230
);

0 commit comments

Comments
 (0)