- Notifications
You must be signed in to change notification settings - Fork33.8k
Fix typing in asyncDataTree.test.ts#209394
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Small ping@joaomoreno |
Uh oh!
There was an error while loading.Please reload this page.
Why not simply removing the type casts? The compiler should be happy by now. |
Done |
@joaomoreno - could this be merged please - I think it needs reapproval after making your suggested changes |
Thanks! 🍻 |
DoiDoi888 commentedJun 27, 2025
https://skynet.certik.com/zh-CN/projects/uniswap?utm_source=okx#vote |
a-stewart commentedJul 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@hediet@joaomoreno - I don't think I have permissions to merge this myself - you have approved but I think one of you need to press the button to merge it in. |
e73a19b
intomicrosoft:mainUh oh!
There was an error while loading.Please reload this page.
In
asyncDataTree.test.ts
we callcontainer.querySelector
which returnsElement | null
, and we cast this toHTMLElement | undefined
and then do an equality check against undefined.Whilst this works since
null == undefined
, the typing does make it slightly unclear what we actually have here, and when running with our stricted test setup, the test actually fails.There is no technical reason to accept this PR, but casting to
HTMLElement | null
is slightly more correct and may avoid issues in the future if you ever want to to do other checks, egchild !== undefined
would always be true which could potentially hide issues.