in packages/codegen-ui-react/lib/react-studio-template-renderer.ts [321:341]
private buildBasePropNode(component: StudioComponent): TypeNode | undefined {
const propsType = this.getPropsTypeName(component);
const componentIsPrimitive = isPrimitive(component.componentType);
if (componentIsPrimitive || isBuiltInIcon(component.componentType)) {
this.importCollection.addImport(ImportSource.UI_REACT, propsType);
} else {
this.importCollection.addImport(`./${component.componentType}`, `${component.componentType}Props`);
}
const propsTypeParameter = componentIsPrimitive
? PrimitiveTypeParameter[Primitive[component.componentType as Primitive]]
: undefined;
const basePropType = factory.createTypeReferenceNode(
factory.createIdentifier(propsType),
propsTypeParameter ? propsTypeParameter.reference() : undefined,
);
return factory.createTypeReferenceNode(factory.createIdentifier('Partial'), [basePropType]);
}