Type errors with noUncheckedIndexedAccess
Closed this issue · 2 comments
dansimau commented
The following example:
import {logger} from "react-native-logs";
const f = logger.createLogger();
f.debug("foo");
Results in:
error TS2722: Cannot invoke an object which is possibly 'undefined'.
f.debug("foo");
~~~~~~~
When compiling to TypeScript with "noUncheckedIndexedAccess": true
:
https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
germisi commented
Check Levels typing
alessandro-bottamedi commented
I added the suggestion in the readme, thank you.