Skip to content

Commit 2dd60ec

Browse files
authored
feat: CHECKOUT-8438. Allow fake ButtonLink (#1391)
1 parent f467238 commit 2dd60ec

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/__type_tests__/button-link-type-test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as React from 'react';
22
import {ButtonLink} from '..';
33

4+
<ButtonLink fake>Text</ButtonLink>;
5+
46
<ButtonLink href="/foo" onNavigate={() => {}}>
57
Text
68
</ButtonLink>;
@@ -21,3 +23,8 @@ import {ButtonLink} from '..';
2123
<ButtonLink onPress={() => {}} onNavigate={() => Promise.resolve()}>
2224
Text
2325
</ButtonLink>;
26+
27+
// @ts-expect-error - bad combination
28+
<ButtonLink fake onPress={() => {}}>
29+
Text
30+
</ButtonLink>;

src/button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ type ButtonProps = ExclusifyUnion<
312312
FakeButtonProps | SubmitButtonProps | ToButtonProps | OnPressButtonProps | HrefButtonProps
313313
>;
314314

315-
type ButtonLinkProps = ExclusifyUnion<ToButtonProps | OnPressButtonProps | HrefButtonProps> & {
315+
type ButtonLinkProps = ExclusifyUnion<
316+
FakeButtonProps | ToButtonProps | OnPressButtonProps | HrefButtonProps
317+
> & {
316318
bleedLeft?: boolean;
317319
bleedRight?: boolean;
318320
bleedY?: boolean;

0 commit comments

Comments
 (0)