Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 错误:[ts]找不到名称';反应_Typescript_Ionic Framework_Ionic4 - Fatal编程技术网

Typescript 错误:[ts]找不到名称';反应

Typescript 错误:[ts]找不到名称';反应,typescript,ionic-framework,ionic4,Typescript,Ionic Framework,Ionic4,出于某些特定原因,我需要定制一点Ionic组件:range,将组件类名从range更改为CustomRange(带选择器:CustomRange): 为此,我将文件复制/粘贴到: 在目录中: /src/components/custom-range 然后我将模块:CustomRange导入到文件app.module.ts中的声明中 还修复了文件range.tsx中的import语句中的引用,这些引用很好 但我的问题是,我遇到了如下错误: [ts] Cannot find name 'Rea

出于某些特定原因,我需要定制一点
Ionic
组件:
range
,将组件类名从
range
更改为
CustomRange
(带选择器:
CustomRange
):

为此,我将文件复制/粘贴到:

在目录中:

/src/components/custom-range
然后我将模块:
CustomRange
导入到文件
app.module.ts
中的声明中

还修复了文件
range.tsx
中的
import
语句中的引用,这些引用很好

但我的问题是,我遇到了如下错误:

[ts] Cannot find name 'React'.
(property) JSX.IntrinsicElements.slot: JSXElements.SlotAttributes
如下图所示:

你知道我该如何解决这个问题吗


谢谢

如果要将JSX与Ionic一起使用,您的
tsconfig.json
中似乎需要有:

"jsx": "react",
"jsxFactory": "h",

然后,只要您从
@stencil/core
导入内容,您就应该得到
h
的全局声明,因此您应该被设置为从“React”导入*为什么将其标记为Angular?您的项目中是否同时包含Angular和react?