Skip to content

Commit

Permalink
Add Typescript types to PrimaryButton and SecondaryButton (#15405)
Browse files Browse the repository at this point in the history
* refactor: change file extensions for SecondaryButton

* refactor: add types for SecondaryButton

* refactor: add types for PrimaryButton
  • Loading branch information
mattborghi authored Dec 29, 2023
1 parent ea5730b commit 17239c5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
*/

import React from 'react';
import Button from '../Button';
import { Button, ButtonProps } from '../Button';

const PrimaryButton = (props) => <Button kind="primary" {...props} />;
const PrimaryButton = <T extends React.ElementType>(props: ButtonProps<T>) => (
<Button kind="primary" {...props} />
);

export default PrimaryButton;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
*/

import React from 'react';
import Button from '../Button';
import { Button, ButtonProps } from '../Button';

const SecondaryButton = (props) => <Button kind="secondary" {...props} />;
const SecondaryButton = <T extends React.ElementType>(
props: ButtonProps<T>
) => <Button kind="secondary" {...props} />;

export default SecondaryButton;

0 comments on commit 17239c5

Please sign in to comment.