Skip to content

Commit

Permalink
better fix for supporting the new object-based react components
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed Oct 24, 2018
1 parent f5a0957 commit 9f9e1ea
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ const BLOCK_SYNTAXES = [
PARAGRAPH_R,
];

function isPlainObject(input) {
return typeof input === 'object' && input.constructor === Object;
}

function containsBlockSyntax(input) {
return BLOCK_SYNTAXES.some(r => r.test(input));
}
Expand Down Expand Up @@ -708,9 +704,9 @@ function getTag(tag, overrides) {

if (!override) return tag;

return isPlainObject(override)
? get(overrides, `${tag}.component`, tag)
: override;
return typeof override === 'function' || (typeof override === 'object' && 'render' in override)
? override
: get(overrides, `${tag}.component`, tag);
}

/**
Expand Down

0 comments on commit 9f9e1ea

Please sign in to comment.