Skip to content

Commit bfca004

Browse files
committed
fix: remove deprecated defaultProps from components
1 parent e9e0608 commit bfca004

4 files changed

Lines changed: 8 additions & 23 deletions

File tree

components/FacebookButton/FacebookButton.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import facebookIcon from './facebook.svg';
44
import styles from './FacebookButton.module.css';
55

66
type FacebookButtonProps = {
7-
width: number;
8-
height: number;
7+
width?: number;
8+
height?: number;
99
};
1010

11-
const FacebookButton = ({ width, height }: FacebookButtonProps) => (
11+
const FacebookButton = ({ width = 50, height = 50 }: FacebookButtonProps) => (
1212
<div className={styles.container}>
1313
<a
1414
href="https://www.facebook.com/httpcats"
@@ -26,9 +26,4 @@ const FacebookButton = ({ width, height }: FacebookButtonProps) => (
2626
</div>
2727
);
2828

29-
FacebookButton.defaultProps = {
30-
width: 50,
31-
height: 50,
32-
};
33-
3429
export default FacebookButton;

components/GithubButton/GithubButton.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import githubIcon from './github.svg';
44
import styles from './GithubButton.module.css';
55

66
type GithubButtonProps = {
7-
width: number;
8-
height: number;
7+
width?: number;
8+
height?: number;
99
};
1010

11-
const GithubButton = ({ width, height }: GithubButtonProps) => (
11+
const GithubButton = ({ width = 50, height = 50 }: GithubButtonProps) => (
1212
<div className={styles.container}>
1313
<a
1414
href="https://github.com/httpcats/http.cat"
@@ -21,9 +21,4 @@ const GithubButton = ({ width, height }: GithubButtonProps) => (
2121
</div>
2222
);
2323

24-
GithubButton.defaultProps = {
25-
width: 50,
26-
height: 50,
27-
};
28-
2924
export default GithubButton;

components/TwitterButton/TwitterButton.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type TwitterButtonProps = {
77
height?: number;
88
};
99

10-
const TwitterButton = ({ width, height }: TwitterButtonProps) => (
10+
const TwitterButton = ({ width = 50, height = 50 }: TwitterButtonProps) => (
1111
<div>
1212
<a
1313
href="https://twitter.com/rogeriopvl"
@@ -25,9 +25,4 @@ const TwitterButton = ({ width, height }: TwitterButtonProps) => (
2525
</div>
2626
);
2727

28-
TwitterButton.defaultProps = {
29-
width: 50,
30-
height: 50,
31-
};
32-
3328
export default TwitterButton;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
7-
"build": "next build",
7+
"build": "next build && rm out/404.html",
88
"start": "next start",
99
"lint": "next lint",
1010
"export": "next export",

0 commit comments

Comments
 (0)