react-component / react-component/trigger

Wrong typing of getPopupContainer

Open
#245 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
391
Forks
245
PR merge metrics
No merged PRs in 30d

Description

By reviewing attachParent method:
https://github.com/react-component/trigger/blob/89eefdb148ee68e4bbfe5b5b2887ceaff6b2e42c/src/index.tsx#L572-L590

that means getPopupContainer is able to return falsy value exactly "in case parent not ready". but it is blocked by strict typings:
https://github.com/react-component/trigger/blob/89eefdb148ee68e4bbfe5b5b2887ceaff6b2e42c/src/index.tsx#L75

may I create PR? actually it is also existent in Tooltip where I came from initially...

Contributor guide

No contributing guide indexed for this repository

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

Start with src/index.tsx, reading attachParent around lines 572-590 and the getPopupContainer type around line 75. Confirm how the runtime handles a falsy value when the parent is not ready, then align the strict typing with that behavior; done means the valid return value is accepted by the TypeScript definitions.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.