Skip to content

Commit 7f56518

Browse files
fix: use asChild prop instead of as prop for Button components
- Fix TypeScript errors in EphemeralParametersDialog and BuildParametersPopover - Use correct Button component pattern with asChild and Link Co-authored-by: jaaydenh <1858163+jaaydenh@users.noreply.github.com>
1 parent 99f7a2d commit 7f56518

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

site/src/components/EphemeralParametersDialog/EphemeralParametersDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export const EphemeralParametersDialog: FC<EphemeralParametersDialogProps> = ({
4040
</div>
4141
<p>You can continue without setting values for these parameters, or go to the workspace parameters page to configure them.</p>
4242
<div style={{ marginTop: "16px" }}>
43-
<Button as={Link} to={parametersPageUrl} onClick={onClose}>
44-
Go to Parameters Page
43+
<Button asChild onClick={onClose}>
44+
<Link to={parametersPageUrl}>Go to Parameters Page</Link>
4545
</Button>
4646
</div>
4747
</>

site/src/pages/WorkspacePage/WorkspaceActions/BuildParametersPopover.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,11 @@ const BuildParametersPopoverContent: FC<BuildParametersPopoverContentProps> = ({
129129
</div>
130130

131131
<Button
132-
as={Link}
133-
to={parametersPageUrl}
132+
asChild
134133
css={{ width: "100%" }}
135134
onClick={() => popover.setOpen(false)}
136135
>
137-
Go to Parameters Page
136+
<Link to={parametersPageUrl}>Go to Parameters Page</Link>
138137
</Button>
139138
</div>
140139
);

0 commit comments

Comments
 (0)