Skip to content

Commit b3559db

Browse files
committed
Use types for React 18 in TS setup
1 parent 8e051ba commit b3559db

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"emitDeclarationOnly": true,
1313
"outDir": "./es",
1414
"forceConsistentCasingInFileNames": true,
15-
"experimentalDecorators":true
15+
"experimentalDecorators": true,
16+
"typeRoots": [
17+
"./node_modules/@types",
18+
"./types"
19+
]
1620
},
1721
"include": ["src/**/*", "test/**/*", "types"],
1822
"exclude": ["node_modules", "dist"]

types/index.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/* eslint-disable no-unused-vars */
1+
/* eslint-disable import/no-unresolved */
2+
import {} from 'react/next'
23

3-
declare module 'react-is' {
4-
import * as React from 'react'
5-
export function isContextConsumer(value: any): value is React.ReactElement
6-
export function isValidElementType(value: any): value is React.ElementType
7-
}
4+
import {} from 'react-dom/next'

0 commit comments

Comments
 (0)