baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.18k stars 2.49k forks source link

TS2345: Argument of type 'typeof SchemaRenderer' is not assignable to parameter of type 'ComponentType<SchemaRendererProps>'. Type 'typeof SchemaRenderer' is not assignable to type 'ComponentClass<SchemaRendererProps, any>'. #9824

Open shudj opened 6 months ago

shudj commented 6 months ago

用新版本得amis-editor yarn dev得时候报这个错误,帮忙看看什么原因导致的? TS2345: Argument of type 'typeof SchemaRenderer' is not assignable to parameter of type 'ComponentType'. Type 'typeof SchemaRenderer' is not assignable to type 'ComponentClass<SchemaRendererProps, any>'. Types of property 'contextType' are incompatible. Type 'React.Context | undefined' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").Context | undefined'. Type 'React.Context' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").Context'. The types of 'Provider.propTypes' are incompatible between these types. Type 'React.WeakValidationMap<React.ProviderProps> | undefined' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").WeakValidationMapimport("D:\\code\\open_source\\amis-editor-demo-master\\node_modules\\@types\\react-router-dom\\node_modules\\@types\\react\\ts5.0\\index").ProviderProps<any>...'. Type 'React.WeakValidationMap<React.ProviderProps>' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").WeakValidationMapimport("D:\\code\\open_source\\amis-editor-demo-master\\node_modules\\@types\\react-router-dom\\node_modules\\@types\\react\\ts5.0\\index").ProviderProps<any>'. Types of property 'children' are incompatible. Type 'React.Validator | undefined' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").Validatorimport("D:\\code\\open_source\\amis-editor-demo-master\\node_modules\\@types\\react-router-dom\\node_modules\\@types\\react\\ts5.0\\index").ReactNode | undefined'. Type 'React.Validator' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\prop-types\index").Validatorimport("D:\\code\\open_source\\amis-editor-demo-master\\node_modules\\@types\\react-router-dom\\node_modules\\@types\\react\\ts5.0\\index").ReactNode'. Type 'React.ReactNode' is not assignable to type 'import("D:\code\open_source\amis-editor-demo-master\node_modules\@types\react-router-dom\node_modules\@types\react\ts5.0\index").ReactNode'. Type '{}' is not assignable to type 'ReactNode'.

2betop commented 6 months ago

请问用的什么版本?有没有问题工程仓库

linzhixiang commented 5 months ago

6.0.0 同样出现这个问题,请问应该使用什么版本

wangg9722 commented 3 months ago

6.5.0 也遇到这个问题了 请问如何解决呢?

hejun200613224 commented 1 month ago

我找别人要了个旧版的lock文件,好像可以了。应该是typescript相关包的版本问题。