Typescript error in React Native package

We have some error with types. Removing the @types/node from node_modules helps. Can we don`t include this dependency in the labrary? Do you have a solution? Since it is not very convenient.

Can you show us the code from where this error is showing?

It is clearly a problem with your TypeScript code.

Yes, this error with every call to setTimeout, etc. If you call window.setTimeout everything is OK. Type error only, code works correctly.

let timeoutId: number
timeoutId = setTimeout(() => console.log(“start”), 0)

If you are using TypeScript, you have to write type safe code.

You can use plain JavaScript, right?

Yes, we can use JS lib without TS code

We use for now hack with postintall…
(rm -rf node_modules/@types/node && rm -rf node_modules/react-native-openvidu/node_modules/@types/node && echo ‘@types/node - delete’)

1 Like