Skip to content

Commit

Permalink
Fix: redundant empty nodes (#1355)
Browse files Browse the repository at this point in the history
* test tmp

* fix

* Revert "test tmp"

This reverts commit ff59ee8.

* f

* f

* f

* fix

* remove all empty text nodes in JSX parser

* f

* f
  • Loading branch information
samijaber authored Feb 7, 2024
1 parent 1a91fa0 commit 97063d5
Show file tree
Hide file tree
Showing 29 changed files with 2,545 additions and 13,030 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-starfishes-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/mitosis': patch
---

Fix: remove all empty text nodes in JSX parser
5 changes: 5 additions & 0 deletions .changeset/strange-pillows-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/mitosis': patch
---

fix: remove redundant {' '} in React generator
28 changes: 13 additions & 15 deletions examples/basic/src/blocks/button.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@ export interface ButtonProps {

export default function Button(props: ButtonProps) {
return (
<>
<Show
when={props.link}
else={<span {...props.attributes}>{props.text}</span>}
<Show
when={props.link}
else={<span {...props.attributes}>{props.text}</span>}
>
<a
{...props.attributes}
role="button"
href={props.link}
target={props.openLinkInNewTab ? '_blank' : undefined}
>
<a
{...props.attributes}
role="button"
href={props.link}
target={props.openLinkInNewTab ? '_blank' : undefined}
>
{props.text}
</a>
</Show>
</>
{props.text}
</a>
</Show>
);
}
}
Loading

0 comments on commit 97063d5

Please sign in to comment.