diff --git a/core/store/src/state/context/components.ts b/core/store/src/state/context/components.ts index 85403934d..1920249d8 100644 --- a/core/store/src/state/context/components.ts +++ b/core/store/src/state/context/components.ts @@ -73,8 +73,8 @@ export const useComponents = ({ } return { ...acc, ...comps }; } - const name = - getComponentName(comp) || Object.keys(doc.componentsLookup)[0]; + const keys = Object.keys(doc.componentsLookup); + const name = keys.length === 1 ? keys[0] : getComponentName(comp); if (name) { const component = getComponent(name); if (component) { diff --git a/examples/docz-migration/docs/playground.mdx b/examples/docz-migration/docs/playground.mdx index 2626bad2f..5396e0e97 100644 --- a/examples/docz-migration/docs/playground.mdx +++ b/examples/docz-migration/docs/playground.mdx @@ -14,7 +14,7 @@ name: Playground menu: Components --- -import { Playground } from '@component-controls/blocks'; +import { Playground, Story } from '@component-controls/blocks'; import { Button } from '../src/components/Button' # Button