Skip to content

fix/accept sfc as component in themr typings #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

raveclassic
Copy link
Contributor

This fix allows themr decorator to accept React.SFC and is related to #39
Here are test cases:

type TFooProps = {
	foo: string
};

type TFooState = {
	bar: number
};

@themr('Symbol()') //ok
class FooClass extends React.Component<TFooProps, TFooState> {
	state = { //ok
		bar: 2123
	};

	render() {
		return <div>hi</div>;
	}
}

const Foo2 = themr('Symbol()')(FooClass); //ok

const FN: React.SFC<TFooProps> = props => (
	<div>hi</div>
);

const fn = themr(Symbol())(FN); //ok

@raveclassic
Copy link
Contributor Author

this is solved in #47

@raveclassic raveclassic deleted the fix/accept_sfc branch February 14, 2017 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant