我正在学习 Typescript-react,但我陷入了这个错误Type '({ items }: PropsWithChildren<TodoProps>) => Element[]' is not assignable to type 'FunctionComponent<TodoProps>',对此我迷失了。
完全错误:
Type '({ items }: PropsWithChildren<TodoProps>) => Element[]' is not assignable to type 'FunctionComponent<TodoProps>'.
Type 'Element[]' is missing the following properties from type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>': type, props, key
Run Code Online (Sandbox Code Playgroud)
代码链接:sandbox repo。
文件中的TodoList函数声明发生错误TodoList.tsx。
任何帮助表示赞赏。干杯! …