Skip to content

Commit

Permalink
Update ComponentRegistry.js
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Apr 18, 2021
1 parent 8c95d61 commit 4ff1136
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/ComponentRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export default class ComponentRegistry {
components.push({ component, mapRule });
}

static mapComponent(question, index, def) {
static mapComponent(question, index, defaultComponent) {
for (let { component, mapRule } of components) {
if (mapRule(question, index)) {
return component;
}
}

if (def !== undefined) {
return def;
if (defaultComponent !== undefined) {
return defaultComponent;
}

return Question;
Expand Down

0 comments on commit 4ff1136

Please sign in to comment.