Skip to content

Commit

Permalink
fix: Removed defaultProps to support react 19 (#211)
Browse files Browse the repository at this point in the history
* Update styled.tsx

* Update styled.tsx
  • Loading branch information
bryanjtc authored Jul 3, 2024
1 parent 9720a1c commit 7f3daef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/styled.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import styled from '@emotion/styled';

import colors from './colors';
Expand All @@ -7,7 +8,16 @@ export const paraGraphDefaultStyle = {
lineHeight: '20px',
};

const Button = styled.button<{ hideBackground?: boolean }>`
interface ButtonBaseProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
}

const ButtonBase = ({ type = 'button', ...props }: ButtonBaseProps) => {
return <ButtonBase type={type} {...props} />;
};

const Button = styled(ButtonBase)<{ hideBackground?: boolean }>`
appearance: none;
margin: 0;
border: 0;
Expand All @@ -23,8 +33,6 @@ const Button = styled.button<{ hideBackground?: boolean }>`
}
`;

Button.defaultProps = { type: 'button' };

const CircleButton = styled(Button)`
font-size: 14px;
font-weight: bold;
Expand Down

0 comments on commit 7f3daef

Please sign in to comment.