Skip to content

Commit

Permalink
apply sami’s suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi committed Nov 21, 2024
1 parent 04da1f6 commit d67920d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/generators/mitosis/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const blockToMitosis = (
for (const key in json.bindings) {
const value = json.bindings[key]?.code as string;

if (json.slots?.[key]) {
if (!value || json.slots?.[key]) {
continue;
}

Expand Down
12 changes: 3 additions & 9 deletions packages/core/src/parsers/builder/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,9 @@ const componentMappers: {
block.component?.options.columns?.map((col: any, index: number) =>
createMitosisNode({
name: 'Column',
/**
* If width if undefined, do not create a binding otherwise its JSX will
* be <Column width={} /> which is not valid due to the empty expression.
*/
...(col.width !== undefined && {
bindings: {
width: { code: col.width.toString() },
},
}),
bindings: {
width: { code: col.width?.toString() },
},
...(col.link && {
properties: {
link: col.link,
Expand Down

0 comments on commit d67920d

Please sign in to comment.