mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #5869 from use-strict/patch-1
Update react.d.ts - Validate static members of React.Component
This commit is contained in:
@@ -84,6 +84,8 @@ class ModernComponent extends React.Component<Props, State>
|
||||
static childContextTypes: React.ValidationMap<ChildContext> = {
|
||||
someOtherValue: React.PropTypes.string
|
||||
}
|
||||
|
||||
static defaultProps: Props;
|
||||
|
||||
context: Context;
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ class ModernComponent extends React.Component<Props, State>
|
||||
someOtherValue: React.PropTypes.string
|
||||
}
|
||||
|
||||
static defaultProps: Props;
|
||||
|
||||
context: Context;
|
||||
|
||||
getChildContext() {
|
||||
|
||||
@@ -82,6 +82,8 @@ class ModernComponent extends React.Component<Props, State>
|
||||
someOtherValue: React.PropTypes.string
|
||||
}
|
||||
|
||||
static defaultProps: Props;
|
||||
|
||||
context: Context;
|
||||
|
||||
getChildContext() {
|
||||
|
||||
Vendored
+10
@@ -132,6 +132,11 @@ declare namespace __React {
|
||||
|
||||
// Base component for plain JS classes
|
||||
class Component<P, S> implements ComponentLifecycle<P, S> {
|
||||
static propTypes: ValidationMap<any>;
|
||||
static contextTypes: ValidationMap<any>;
|
||||
static childContextTypes: ValidationMap<any>;
|
||||
static defaultProps: Props<any>;
|
||||
|
||||
constructor(props?: P, context?: any);
|
||||
setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
|
||||
setState(state: S, callback?: () => any): void;
|
||||
@@ -935,6 +940,11 @@ declare module "react/addons" {
|
||||
|
||||
// Base component for plain JS classes
|
||||
class Component<P, S> implements ComponentLifecycle<P, S> {
|
||||
static propTypes: ValidationMap<any>;
|
||||
static contextTypes: ValidationMap<any>;
|
||||
static childContextTypes: ValidationMap<any>;
|
||||
static defaultProps: Props<any>;
|
||||
|
||||
constructor(props?: P, context?: any);
|
||||
setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
|
||||
setState(state: S, callback?: () => any): void;
|
||||
|
||||
Reference in New Issue
Block a user