diff --git a/react-redux/react-redux-tests.tsx b/react-redux/react-redux-tests.tsx index 9bd662295a..6dac834206 100644 --- a/react-redux/react-redux-tests.tsx +++ b/react-redux/react-redux-tests.tsx @@ -23,13 +23,13 @@ interface CounterState { declare var increment: Function; class Counter extends Component { - render() { - return ( - - ); - } + render() { + return ( + + ); + } } function mapStateToProps(state: CounterState) { @@ -242,3 +242,14 @@ connect(mapStateToProps2, actionCreators, mergeProps)(TodoApp); + + +// Ensure return value of the connect()(TodoApp) is of the type TodoApp +let WrappedTodoApp: typeof TodoApp = connect()(TodoApp); + +// connect()(SomeClass) has the same constructor as SomeClass itself +class SomeClass { + constructor(public foo: string) { } + public bar: number; +} +let bar: number = new (connect()(SomeClass))("foo").bar; diff --git a/react-redux/react-redux.d.ts b/react-redux/react-redux.d.ts index f1ef5458e1..03af3e06d8 100644 --- a/react-redux/react-redux.d.ts +++ b/react-redux/react-redux.d.ts @@ -11,7 +11,7 @@ declare module "react-redux" { import { Store, Dispatch, ActionCreator } from 'redux'; export interface ClassDecorator { - (target: TFunction): TFunction|void; + (target: TFunction): TFunction; } /**