Skip to content

Commit

Permalink
fix: Ignore invalid exported components (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts committed Oct 19, 2020
1 parent 83f51d7 commit 0c69e1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Expand Up @@ -18,11 +18,16 @@ polyfillIntersectionObserver().then(() => {

const renderPlayroom = ({
themes = require('./themes'),
components = require('./components'),
importedComponents = require('./components'),
snippets = require('./snippets'),
} = {}) => {
const themeNames = Object.keys(themes);

// Exclude undefined components, e.g. an exported TypeScript type.
const components = Object.fromEntries(
Object.entries(importedComponents).filter(([_, value]) => value)
);

render(
<StoreProvider themes={themeNames} widths={widths}>
<Playroom
Expand Down

0 comments on commit 0c69e1c

Please sign in to comment.