Skip to content

Commit af6640a

Browse files
committed
fix: allow string slots
1 parent bca7250 commit af6640a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storyhelpers/render-slots.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ function renderSlots(param: TemplateResult[] | Args) {
3434
// Join slots with consistent formatting; no extra line breaks between them
3535
const spacing = ' ';
3636

37-
const stringSlots = validSlots.map(slot => slot.strings[0]);
37+
const stringSlots = validSlots.map(slot =>
38+
typeof slot === 'string' ? slot : slot.strings?.[0] ?? '',
39+
);
3840
const stringSlotsJoined = stringSlots.join('\n');
3941
const stringSlotsJoinedWithSpacing = stringSlotsJoined
4042
.split('\n')

0 commit comments

Comments
 (0)