Skip to content
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

Support for TSAsExpression ast type? #401

Closed
bryceosterhaus opened this issue Nov 5, 2019 · 0 comments · Fixed by #408
Closed

Support for TSAsExpression ast type? #401

bryceosterhaus opened this issue Nov 5, 2019 · 0 comments · Fixed by #408

Comments

@bryceosterhaus
Copy link
Contributor

I currently have the following code, and it breaks when I run parse with the error No suitable component definition found

import React from 'react';

const Group = React.forwardRef<
	HTMLDivElement,
	React.HTMLAttributes<HTMLDivElement>
>((props, ref) => {
	return <div {...props} ref={ref} />;
});

type TInput = React.ForwardRefExoticComponent<
	React.HTMLAttributes<HTMLInputElement> &
		React.RefAttributes<HTMLInputElement>
> & {Group: typeof Group};

const Input = React.forwardRef<
	HTMLInputElement,
	React.HTMLAttributes<HTMLInputElement>
>((props, ref) => {
	return <input {...props} ref={ref} />;
}) as TInput;

Input.Group = Group;

export default Input;
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant