JedWatson / JedWatson/react-select

@types/react interferes with preact types

Open
#4,962 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

I noticed this package uses @types/react-transition-group as a regular dependency which in turn depends on @types/react. @types/react interferes with the JSX types from preact so we get warnings like:

'MenuLink' cannot be used as a JSX component.
  Its instance type 'Component<IMenuLink, {}>' is not a valid JSX element.ts(2786)

Are there any problems with moving @types/react-transition-group into devDependencies? This seems to fix our issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the package's dependency declarations and the role of @types/react-transition-group and its transitive @types/react dependency. Confirm whether moving it to devDependencies removes the Preact JSX warnings without breaking the package's supported TypeScript and React usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.