Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Replace ElementConfig with JSX.LibraryManagedAttributes #155

Closed
SBoudrias opened this issue Mar 20, 2020 · 2 comments
Closed

Replace ElementConfig with JSX.LibraryManagedAttributes #155

SBoudrias opened this issue Mar 20, 2020 · 2 comments
Assignees

Comments

@SBoudrias
Copy link

Missing transform for compatibility with TS:

- type TestProps = React.ElementConfig<Test>;
+ type TestProps = JSX.LibraryManagedAttributes<typeof Test, Test["props"]>;

I found most details on microsoft/TypeScript#26704

@kevinbarabash
Copy link
Contributor

kevinbarabash commented Mar 7, 2021

In order to handle functional components the conversion will need to be:

type TestProps = React.ElementConfig<typeof Test>;
type TestProps = JSX.LibraryManagedAttributes<
    typeof Test,
    React.ComponentProps<typeof Test>
>;

@kevinbarabash
Copy link
Contributor

Older versions of Flow allowed passing the component directly to React.ElementConfig<>, but now you have to pass the component's type.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants