diff --git a/ui/blocks/src/ComponentSource/BaseComponentSource.tsx b/ui/blocks/src/ComponentSource/BaseComponentSource.tsx index 84312050d..3d3f48283 100644 --- a/ui/blocks/src/ComponentSource/BaseComponentSource.tsx +++ b/ui/blocks/src/ComponentSource/BaseComponentSource.tsx @@ -35,11 +35,11 @@ export const BaseComponentSource: FC = props => { const [showType, setShowType] = useState('import'); const custom = useCustomProps(NAME, props); const { component, actions, ...rest } = custom; + const componentPackage = usePackage(component?.package); if (!component) { return null; } let source; - const componentPackage = usePackage(component.package); const { from, importedName, name: componentName } = component; const importFrom = componentPackage && componentPackage.name ? componentPackage.name : from;