Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore invalid exported components #140

Merged
merged 12 commits into from Oct 19, 2020
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