-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix types build by specifying return type on portal render method #5159
Fix types build by specifying return type on portal render method #5159
Conversation
This fix solves the warning printed by rollup during build of types, which is preventing the generation of the portal.d.ts file. Specifycally, the TS error is the following: TS2742: The inferred type of render cannot be named without a reference to react-dom/ node_modules/@types/ react. This is likely not portable. A type annotation is necessary. Fixes Hacker0x01#5129
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@beawar you can click here to see the review status or cancel the code review job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 1
- 1
100% TSX
Type of change
Fix - These changes are likely to be fixing a bug or issue.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5159 +/- ##
=======================================
Coverage 96.89% 96.89%
=======================================
Files 29 29
Lines 3350 3350
Branches 1405 1409 +4
=======================================
Hits 3246 3246
+ Misses 104 102 -2
- Partials 0 2 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should effectively address the missing type declaration warning.
Reviewed with ❤️ by PullRequest
Description
Linked issue: #5129
Problem
There is a warning printed by rollup during build of types, which is preventing the generation of the portal.d.ts file.
Specifically, the TS error is the following:
TS2742: The inferred type of render cannot be named without a reference to react-dom/ node_modules/@types/ react. This is likely not portable. A type annotation is necessary.
This warning is actually an error which is preventing the generation of the declaration file for the portal.tsx.
Changes
Added the return type to the render method of the portal class
Screenshots
To reviewers
Contribution checklist