Skip to content

Commit d38bab6

Browse files
committed
TextButton: use ...props per component convention; align README example with Default story
1 parent 54ca69b commit d38bab6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/design-system-react/src/components/TextButton/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pass `onClick` to handle interaction.
1111
```tsx
1212
import { TextButton } from '@metamask/design-system-react';
1313

14-
<TextButton onClick={() => console.log('Clicked')}>Click me</TextButton>;
14+
<TextButton>Text Button</TextButton>;
1515
```
1616

1717
<Canvas of={TextButtonStories.Default} />

packages/design-system-react/src/components/TextButton/TextButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(
2626
style,
2727
onClick,
2828
type = 'button',
29-
...rest
29+
...props
3030
},
3131
ref,
3232
) => {
@@ -52,7 +52,7 @@ export const TextButton = forwardRef<HTMLButtonElement, TextButtonProps>(
5252
className={mergedClassName}
5353
style={style}
5454
>
55-
<button ref={ref} type={type} onClick={onClick} {...rest}>
55+
<button ref={ref} type={type} onClick={onClick} {...props}>
5656
{children}
5757
</button>
5858
</Text>

0 commit comments

Comments
 (0)