Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was 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

@shirakaba

Description

@shirakaba

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions