[@types/react] Ref callback function should be required to accept null argument #58464
Replies: 2 comments
-
|
Thanks for the discussion about "react", some useful links for everyone: Pinging the DT module owners: @johnnyreilly, @bbenezech, @pzavolinsky, @ericanderson, @DovydasNavickas, @theruther4d, @guilhermehubner, @ferdaber, @jrakotoharisoa, @pascaloliv, @Hotell, @franklixuefei, @Jessidhia, @saranshkataria, @lukyth, @eps1lon, @zieka, @dancerphil, @dimitropoulos, @disjukr, @vhfmag, @hellatan, @priyanshurav. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for opening the issue. This actually hides quite a lot of bugs in this repository. This is currently caused by our bivariance hack. But I can't reproduce why we needed it here. Or maybe it was only required for older TypeScript version. I opened #58936 with a fix to get some more eyes on it. Maybe somebody remembers if we still need the bivariance hack. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A ref callback will receive
nullas an argument. But it's possible to give React a ref callback that does not acceptnullwithout a type error.This code should give an error but it does not (playground link).
Beta Was this translation helpful? Give feedback.
All reactions