Skip to content

Commit

Permalink
Add Typescript types to PrimaryButton and SecondaryButton (carbon-des…
Browse files Browse the repository at this point in the history
…ign-system#15405)

* refactor: change file extensions for SecondaryButton

* refactor: add types for SecondaryButton

* refactor: add types for PrimaryButton
  • Loading branch information
mattborghi authored and danoro96 committed Jan 18, 2024
1 parent 49715fb commit 49f7240
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 49f7240

Please sign in to comment.