openspacelabs / react-native-zoomable-view

A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
MIT License
191 stars 58 forks source link

Fix nullable types not throwing ts errors #51

Open thomasttvo opened 1 year ago

thomasttvo commented 1 year ago

48 indicates there's a problem with the typescript set up where it doesn't alert if a property getter is called on a nullable variable.

// b is Vec2 | null
const a = b.x + 1 // this should throw ts-error, but it doesn't
yuri-lomashko-itechart commented 1 year ago

That behavior depends on flag strict: false in tsconfig.json. I don't know the reasons why it's false, but it disables some useful validations in TS. To have just null checking you can enable another flag - strictNullChecks: true