Skip to content

Commit 7f3daef

Browse files
authored
fix: Removed defaultProps to support react 19 (#211)
* Update styled.tsx * Update styled.tsx
1 parent 9720a1c commit 7f3daef

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/styled.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import styled from '@emotion/styled';
23

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

10-
const Button = styled.button<{ hideBackground?: boolean }>`
11+
interface ButtonBaseProps
12+
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13+
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
14+
}
15+
16+
const ButtonBase = ({ type = 'button', ...props }: ButtonBaseProps) => {
17+
return <ButtonBase type={type} {...props} />;
18+
};
19+
20+
const Button = styled(ButtonBase)<{ hideBackground?: boolean }>`
1121
appearance: none;
1222
margin: 0;
1323
border: 0;
@@ -23,8 +33,6 @@ const Button = styled.button<{ hideBackground?: boolean }>`
2333
}
2434
`;
2535

26-
Button.defaultProps = { type: 'button' };
27-
2836
const CircleButton = styled(Button)`
2937
font-size: 14px;
3038
font-weight: bold;

0 commit comments

Comments
 (0)