Skip to content

Commit

Permalink
fix(PropertyFactory): Allow dynamic widget registration
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jan 17, 2018
1 parent d2d51b0 commit 8ab744d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/React/Properties/PropertyFactory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ function capitalize(str) {
return str[0].toUpperCase() + str.substr(1).toLowerCase();
}

export default function (prop, vd, onChange) {
export default function render(prop, vd, onChange) {
var fn = factoryMapping[capitalize(prop.ui.propType)];
if (fn) {
return fn(prop, vd, onChange);
}
return null;
}

render.updateWidgetMapping = (name, fn) => {
factoryMapping[name] = fn;
};

0 comments on commit 8ab744d

Please sign in to comment.