Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Allow Component<void, void>
  • Loading branch information
tkrotoff committed Jan 11, 2017
1 parent 44ea13d commit 63be8adf59c1dd179969a8f26046d62bd4624967
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
@@ -8,7 +8,7 @@ export type IReactComponent<P> = React.StatelessComponent<P> | React.ComponentCl

export function observer<P>(clazz: IReactComponent<P>): React.ClassicComponentClass<P>;
export function observer<P>(clazz: React.ClassicComponentClass<P>): React.ClassicComponentClass<P>;
export function observer<P, TFunction extends React.ComponentClass<P>>(target: TFunction): TFunction; // decorator signature
export function observer<P, TFunction extends React.ComponentClass<P | void>>(target: TFunction): TFunction; // decorator signature

export function inject<P>(...stores: string[]): <TFunction extends IReactComponent<P>>(target: TFunction) => TFunction; // decorator signature
export function inject<T, P>(storesToProps : IStoresToProps<T, P>): <TFunction extends IReactComponent<T | P>>(target: TFunction) => TFunction; // decorator
@@ -151,3 +151,13 @@ class ObserverTest extends Component<any, any> {
return <Observer>{() => <div>test</div>}</Observer>;
}
}

@observer
class ComponentWithoutPropsAndState extends Component<void, void> {
componentDidUpdate() {
}

render() {
return (<div>Hello!</div>)
}
}

0 comments on commit 63be8ad

Please sign in to comment.