Skip to content

Commit d82751b

Browse files
fix typescript errors
1 parent 013e60b commit d82751b

34 files changed

+201
-160
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"rules": {
77
"no-unused-vars": "off",
88
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
9-
"react-hooks/exhaustive-deps": "error"
9+
"react-hooks/exhaustive-deps": "error",
10+
"react/no-unknown-property": ["error", { "ignore": ["meta"] }]
1011
},
1112
"env": {
1213
"node": true,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"@types/mdx-js__react": "^1.5.2",
5656
"@types/node": "^14.6.4",
5757
"@types/parse-numeric-range": "^0.0.1",
58-
"@types/react": "^18.0.9",
59-
"@types/react-dom": "^18.0.5",
58+
"@types/react": "^19.0.0",
59+
"@types/react-dom": "^19.0.0",
6060
"@typescript-eslint/eslint-plugin": "^5.36.2",
6161
"@typescript-eslint/parser": "^5.36.2",
6262
"asyncro": "^3.0.0",

src/components/ExternalLink.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
/*
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
4+
import type {DetailedHTMLProps, AnchorHTMLAttributes} from 'react';
45

56
export function ExternalLink({
67
href,
78
target,
89
children,
910
...props
10-
}: JSX.IntrinsicElements['a']) {
11+
}: DetailedHTMLProps<
12+
AnchorHTMLAttributes<HTMLAnchorElement>,
13+
HTMLAnchorElement
14+
>) {
1115
return (
1216
<a href={href} target={target ?? '_blank'} rel="noopener" {...props}>
1317
{children}

src/components/Icon/IconArrow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import {memo} from 'react';
66
import cn from 'classnames';
7+
import type {SVGProps} from 'react';
78

89
export const IconArrow = memo<
9-
JSX.IntrinsicElements['svg'] & {
10+
SVGProps<SVGSVGElement> & {
1011
/**
1112
* The direction the arrow should point.
1213
* `start` and `end` are relative to the current locale.

src/components/Icon/IconArrowSmall.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import {memo} from 'react';
66
import cn from 'classnames';
7+
import type {SVGProps} from 'react';
78

89
export const IconArrowSmall = memo<
9-
JSX.IntrinsicElements['svg'] & {
10+
SVGProps<SVGSVGElement> & {
1011
/**
1112
* The direction the arrow should point.
1213
* `start` and `end` are relative to the current locale.

src/components/Icon/IconBsky.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
*/
44

55
import {memo} from 'react';
6+
import type {SVGProps} from 'react';
67

7-
export const IconBsky = memo<JSX.IntrinsicElements['svg']>(function IconBsky(
8-
props
9-
) {
8+
export const IconBsky = memo<SVGProps<SVGSVGElement>>(function IconBsky(props) {
109
return (
1110
<svg
1211
aria-label="Bluesky"

src/components/Icon/IconClose.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*/
44

55
import {memo} from 'react';
6+
import type {SVGProps} from 'react';
67

7-
export const IconClose = memo<JSX.IntrinsicElements['svg']>(function IconClose(
8+
export const IconClose = memo<SVGProps<SVGSVGElement>>(function IconClose(
89
props
910
) {
1011
return (

src/components/Icon/IconFacebookCircle.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*/
44

55
import {memo} from 'react';
6+
import type {SVGProps} from 'react';
67

7-
export const IconFacebookCircle = memo<JSX.IntrinsicElements['svg']>(
8+
export const IconFacebookCircle = memo<SVGProps<SVGSVGElement>>(
89
function IconFacebookCircle(props) {
910
return (
1011
<svg

src/components/Icon/IconGitHub.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
*/
44

55
import {memo} from 'react';
6+
import type {SVGProps} from 'react';
67

7-
export const IconGitHub = memo<JSX.IntrinsicElements['svg']>(
8-
function IconGitHub(props) {
9-
return (
10-
<svg
11-
xmlns="http://www.w3.org/2000/svg"
12-
width="1.5em"
13-
height="1.5em"
14-
viewBox="0 -2 24 24"
15-
fill="currentColor"
16-
{...props}>
17-
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
18-
</svg>
19-
);
20-
}
21-
);
8+
export const IconGitHub = memo<SVGProps<SVGSVGElement>>(function IconGitHub(
9+
props
10+
) {
11+
return (
12+
<svg
13+
xmlns="http://www.w3.org/2000/svg"
14+
width="1.5em"
15+
height="1.5em"
16+
viewBox="0 -2 24 24"
17+
fill="currentColor"
18+
{...props}>
19+
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
20+
</svg>
21+
);
22+
});

src/components/Icon/IconHamburger.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*/
44

55
import {memo} from 'react';
6+
import type {SVGProps} from 'react';
67

7-
export const IconHamburger = memo<JSX.IntrinsicElements['svg']>(
8+
export const IconHamburger = memo<SVGProps<SVGSVGElement>>(
89
function IconHamburger(props) {
910
return (
1011
<svg

0 commit comments

Comments
 (0)