Add index signature to 'ComponentSpec' in 'react'.

This commit is contained in:
Daniel Rosenwasser
2015-08-20 14:32:32 -07:00
parent c8157285b7
commit d2f69d40ab
3 changed files with 9 additions and 5 deletions
+2
View File
@@ -215,6 +215,8 @@ declare module React {
interface ComponentSpec<P, S> extends Mixin<P, S> {
render(): ReactElement<any>;
[propertyName: string]: any;
}
//
+5 -5
View File
@@ -41,24 +41,24 @@ var container: Element;
var ClassicComponent: React.ClassicComponentClass<Props> =
React.createClass<Props, State>({
getDefaultProps: () => {
getDefaultProps() {
return <Props>{
hello: undefined,
world: "peace",
foo: undefined,
bar: undefined
bar: undefined,
};
},
getInitialState: () => {
getInitialState() {
return {
inputValue: this.context.someValue,
seconds: this.props.foo
};
},
reset: () => {
reset() {
this.replaceState(this.getInitialState());
},
render: () => {
render() {
return React.DOM.div(null,
React.DOM.input({
ref: input => this._input = input,
+2
View File
@@ -215,6 +215,8 @@ declare module __React {
interface ComponentSpec<P, S> extends Mixin<P, S> {
render(): ReactElement<any>;
[propertyName: string]: any;
}
//