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

Add support for prop types which extend other types/interfaces #117

Open
GlennSouthern opened this issue Feb 6, 2020 · 3 comments
Open

Comments

@GlennSouthern
Copy link

For example

interface Foo {
 foo: boolean;
}
interface BarProps extends Foo {
 bar: string;
}
const BarComponent: FC<BarProps> = (props) => {}
@Noviny
Copy link
Contributor

Noviny commented Feb 6, 2020

Issue makes sense - just commenting that if you are only using typescript, we've also built a library called magical types that's basically this but slightly better because it only needs to resolve typescript, and taking advantage of that.

@DarkPurple141
Copy link

@Noviny what's a like for like usage of extractReactTypes vs magical-types look like?

eg:

const { extractReactTypes } = require('extract-react-types');

/// ....
extractReactTypes(content, typeSystem, filename, resolveOpts);

Roughly translates to which API in @magical-types

@strange
Copy link

strange commented Oct 4, 2021

Same issue here. As soon as we do something like:

const Label: FC<Props & ComponentProps<'label'>> = ({ [...]

We end up with nothing in ___types at all.

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

No branches or pull requests

4 participants