mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
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:
committed by
Orta
parent
dd4a93f39b
commit
bcff64de55
@@ -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> = {
|
||||
|
||||
Reference in New Issue
Block a user