Skip to content

Fix up hacky detection of React.Component and React.ReactNode #4

Open
@grncdr

Description

@grncdr

Currently the code just stringifies types and compares them against constant strings. This doesn't work if the import isn't named React.

Investigation needed: can we do reliable symbol comparisons with ts.Symbol.equals?

Tests should cover:

  • import {Component, ReactNode} from 'react' && class Foo extends Component<{n: ReactNode}> {}
  • import * as R from 'react': class Foo extends R.Component<{n: R.ReactNode}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions