Closed
Description
Bug Report
🔎 Search Terms
Object is possibly 'null'
undefined
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about unexpected warnings about possible 'null's and 'undefined's.
I tried versions 3.3.3333
and 4.3.0-beta
, though I did not try any in the middle.
⏯ Playground Link
Playground link with relevant code
💻 Code
const refs: {current: {value: number} | null}[] = [{current: { value: 2}}];
if (refs.every((ref) => ref.current != null)) {
refs[0].current.value = 1;
}
🙁 Actual behavior
"Object is possibly 'null'" warning on refs[0].current
🙂 Expected behavior
No warnings, as they cannot be null since the refs.every(...)
is checking that.