mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-06 16:20:26 +08:00
Add index signature to 'ComponentSpec' in 'react'.
This commit is contained in:
Vendored
+2
@@ -215,6 +215,8 @@ declare module React {
|
||||
|
||||
interface ComponentSpec<P, S> extends Mixin<P, S> {
|
||||
render(): ReactElement<any>;
|
||||
|
||||
[propertyName: string]: any;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -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,
|
||||
|
||||
Vendored
+2
@@ -215,6 +215,8 @@ declare module __React {
|
||||
|
||||
interface ComponentSpec<P, S> extends Mixin<P, S> {
|
||||
render(): ReactElement<any>;
|
||||
|
||||
[propertyName: string]: any;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user