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

How can I remove the dependency on prop-types (as TypeScript provides type-safety already)? #63

Open
shirakaba opened this issue Apr 1, 2018 · 0 comments

Comments

@shirakaba
Copy link

In order to subscribe to the <Loop> component's loop, I need to import prop-types as a module dependency, and add the following field into any class extending React.Component:

static contextTypes = {
    loop: PropTypes.object,
};

However, upon doing this, all other static fields on my TypeScript class (eg. functions and variables) begin to return undefined whenever referenced.

Is it possible to subscribe to the <Loop> component's loop without using prop-types at all, and without warnings being thrown in the console? Or at least is there a way to use the prop-types package without breaking other static functions in TypeScript classes?

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

No branches or pull requests

1 participant