-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[TS migration] Reafactor tooltips.js to use typescript #2073
[TS migration] Reafactor tooltips.js to use typescript #2073
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
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.
Sweet! Thanks for taking your time to help with the TS migration. Let me know what you think about my comments. :)
@@ -138,9 +184,10 @@ export class Tooltip extends Component { | |||
} | |||
|
|||
const box = contentEl.getBoundingClientRect(); | |||
const anchorEl = this.target.parentNode; | |||
const anchorEl = this.target.parentNode as HTMLElement; |
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.
❓ question: same question here
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.
I think this is necessary because .partentNode
is of type ParentNode
which you can't call getBoundingClientRect
on.
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.
Might need to add a type guard here. That would solve the problem.
In my experience manual type coercions tend to lead to subtle bugs that are very hard to catch. Hence why I'm so nitpicky about them. Sorry about that.
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
@MatissJanis Thanks for your patience, hopefully this is good. |
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.
No; thank YOU for your patience :)
Great job!
Link to: #1483
Converted tooltips.js to tooltips.tsx and created types where I was able to work them out.
Let me know if you have any feedback