-
Notifications
You must be signed in to change notification settings - Fork 28
Reactotron.log + typescript - cannot invoke an object which is possibly 'undefined' #239
Comments
I found a temporary solution in this thread #168 (comment) |
Since in our Reactotron.log!('hey there') Same goes for any other optional functions you're calling like Use newer optional chaining (TS 3.7+) if preferred. Bonus: Here's a way to add type safety with linting |
The @leotm solution is correct, it even works for other cases such as when using |
Hey Patrick... you mean in the store configuration? How did you do it ? thanks |
@AndreCosta101 Something like this:
|
But this solution gives this warning - "Forbidden non-null assertion." |
Reactotron.log?.('hey there') Since TypeScript 3.7 |
reactotron-react-native v4.0.3
Saw a similar issue which was supposedly resolved. Maybe I'm missing something?
The text was updated successfully, but these errors were encountered: