Skip to content

Conversation

@FelixPflaum
Copy link
Contributor

No description provided.

@FelixPflaum FelixPflaum marked this pull request as ready for review April 3, 2025 15:28

this.tableElem = this.rootElem.getElementsByClassName('metrics-table')[0] as HTMLTableSectionElement;
this.bodyElem = this.rootElem.getElementsByClassName('metrics-table-body')[0] as HTMLElement;
this.tableElem = this.rootElem.querySelector('.metrics-table') as HTMLTableElement;
Copy link
Contributor

@1337LutZ 1337LutZ Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass the HTMLTableElement as a generic: .querySelector<HTMLTableElement>()! and then use ! to tell TS you are sure this is never undefined. Cleaner than typecasting (i tried to fix this in a lot of legacy components)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol used typecasting because it's done everywhere else like that. Should I just regex replace all of them then? :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get rid of it where I did major refactors 😅😂 feel free to run a find replace regex tbh 👌🫠

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kayla-glick
Copy link
Collaborator

Gonna go ahead and merge this 👍 Thanks @FelixPflaum ! I opened issue in the Classic, Cata, and Wrath repos as well to track porting it

@kayla-glick kayla-glick merged commit 9636052 into wowsims:master Apr 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants