Skip to content

Commit

Permalink
fix: don't render defaults to if the property is not optional (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Nov 14, 2024
1 parent 3fecb5d commit 4a43aba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/app/src/type-shorthand/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function renderTypeShorthandRoot(
toPrimitiveTypeLabels({ primitive: unwrapped.shape.value }).map((label, index) => (
<code key={index}>{label}</code>
))}
{unwrapped.default != null && (
{unwrapped.default != null && unwrapped.isOptional && (
<span>
{"Defaults to "}
<code>{unknownToString(unwrapped.default)}</code>
Expand Down

0 comments on commit 4a43aba

Please sign in to comment.