You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're just upgrading to TypeScript 5.6 in our project, and came across a problem in the types in react-arborist:
node_modules/react-arborist/src/interfaces/tree-api.ts:596:12 - error TS2869: Right operand of ?? is unreachable because the left operand is never nullish.
596 return !utils.access(data, check) ?? true;
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/react-arborist/src/interfaces/tree-api.ts:601:12 - error TS2869: Right operand of ?? is unreachable because the left operand is never nullish.
601 return !utils.access(data, check) ?? true;
This seems to make sense - TypeScript is right that this line:
Will never execute the branch on the right, because ! will cast the result of the utils.access call to a boolean, so it'll never be nullish, so it'll never fall back to true.
The text was updated successfully, but these errors were encountered:
tmcw
linked a pull request
Sep 16, 2024
that will
close
this issue
We're just upgrading to TypeScript 5.6 in our project, and came across a problem in the types in react-arborist:
This seems to make sense - TypeScript is right that this line:
react-arborist/modules/react-arborist/src/interfaces/tree-api.ts
Line 596 in 3cee71c
Will never execute the branch on the right, because
!
will cast the result of theutils.access
call to a boolean, so it'll never be nullish, so it'll never fall back totrue
.The text was updated successfully, but these errors were encountered: