【发布时间】:2019-08-17 15:29:08
【问题描述】:
我在这里遗漏了一些关于验证如何添加类型验证的内容?出现错误“元素‘孩子’隐含地具有‘任何’类型”。
import * as React from 'react';
import Button from './Styles';
const Button1 = ({ children, ...props }) => (
<Button {...props}>{children}</Button>
);
Button1.propTypes = {};
export default Button1;
【问题讨论】:
-
@BoyWithSilverWings 几乎但不是真的,因为这个问题是关于 propTypes 和类型应该是什么,这个问题是关于打字稿以及导致此错误的原因。
标签: reactjs typescript