[Bug] A reference without setting a component errors out when generating
jjwilliams42 opened this issue · 1 comments
jjwilliams42 commented
I accidentally added a reference to my design, then tried to generate code - but nothing is ever displayed.
I think it is because a null check needs to happen here (in code.js):
Old:
const nextReferenceDesign = getReferenceDesign(importsArg, component);
result = componentToJSX({
screen,
id: component.props.component,
indent,
referenceDesign: nextReferenceDesign,
});
New:
const nextReferenceDesign = getReferenceDesign(importsArg, component);
result = nextReferenceDesign ? componentToJSX({
screen,
id: component.props.component,
indent,
referenceDesign: nextReferenceDesign,
}) : '';
Incoming PR ...
jjwilliams42 commented
Closing since PR was merged