Skip to content

Commit d74c69d

Browse files
committed
Remove unnecesary div
1 parent 54ad328 commit d74c69d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

packages/smooth-code/src/code-tween.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function Wrapper({
180180
...htmlProps?.style,
181181
}}
182182
>
183-
<code>{children}</code>
183+
{children}
184184
</pre>
185185
)
186186
}

packages/smooth-code/src/smooth-container.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,17 @@ function Container({
8585
children: React.ReactNode
8686
}) {
8787
return (
88-
<div
88+
<code
8989
style={{
9090
width,
9191
height,
9292
position: "relative",
93+
display: "block",
9394
// overflowX: "auto",
9495
}}
9596
>
9697
{children}
97-
</div>
98+
</code>
9899
)
99100
}
100101

packages/smooth-code/src/use-dimensions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function useDimensions(
6464
.split(newlineRe)
6565

6666
const element = (
67-
<>
67+
<code style={{ display: "block" }}>
6868
<br />
6969
{lines.map((line, i) => (
7070
<div
@@ -81,7 +81,7 @@ function useDimensions(
8181
</div>
8282
))}
8383
<br />
84-
</>
84+
</code>
8585
)
8686
return { prevLongestLine, nextLongestLine, element }
8787
}, [code])

0 commit comments

Comments
 (0)