extract-react-types
extract-react-types copied to clipboard
Add support for prop types which extend other types/interfaces
For example
interface Foo {
foo: boolean;
}
interface BarProps extends Foo {
bar: string;
}
const BarComponent: FC<BarProps> = (props) => {}
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.
@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
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.