test(react): Remove usage of React.Attributes (#38352)

Only includes `key` with which you'll never deal
in props validation
This commit is contained in:
Sebastian Silbermann
2019-09-17 13:12:49 +02:00
committed by Orta
parent dd4a93f39b
commit bcff64de55

View File

@@ -22,7 +22,7 @@ interface Console {
log(...args: any[]): void;
}
interface Props extends React.Attributes {
interface Props {
hello: string;
world?: string | null;
foo: number;
@@ -132,8 +132,7 @@ class ModernComponent extends React.Component<Props, State, Snapshot>
static propTypes: React.ValidationMap<Props> = {
hello: PropTypes.string.isRequired,
world: PropTypes.string,
foo: PropTypes.number.isRequired,
key: PropTypes.oneOfType([PropTypes.number, PropTypes.string]) as PropTypes.Validator<string | number | undefined>
foo: PropTypes.number.isRequired
};
static contextTypes: React.ValidationMap<Context> = {