Merge pull request #5201 from use-strict/react-context-any

react - Replaced context any with {} for type safety.
This commit is contained in:
Masahiro Wakame
2015-08-08 13:53:54 +09:00
5 changed files with 7 additions and 3 deletions
+2
View File
@@ -84,6 +84,8 @@ class ModernComponent extends React.Component<Props, State>
someOtherValue: React.PropTypes.string
}
context: Context;
getChildContext() {
return {
someOtherValue: 'foo'
+1 -1
View File
@@ -137,7 +137,7 @@ declare module "react/addons" {
forceUpdate(): void;
props: P;
state: S;
context: any;
context: {};
refs: {
[key: string]: Component<any, any>
};
+1 -1
View File
@@ -139,7 +139,7 @@ declare module React {
render(): JSX.Element;
props: P;
state: S;
context: any;
context: {};
refs: {
[key: string]: Component<any, any>
};
+2
View File
@@ -82,6 +82,8 @@ class ModernComponent extends React.Component<Props, State>
someOtherValue: React.PropTypes.string
}
context: Context;
getChildContext() {
return {
someOtherValue: 'foo'
+1 -1
View File
@@ -139,7 +139,7 @@ declare module __React {
render(): JSX.Element;
props: P;
state: S;
context: any;
context: {};
refs: {
[key: string]: Component<any, any>
};