itinance/react-native-sha256

Typescript

KeiShadow opened this issue · 4 comments

Hello is there any wayt used this module with react-native typescript?
Im using it in react-native without typescript and its working good, but when im trying it with typescript it show me a warning with this message:
null is not an object (evaluating 'sha256Lib.sha256')
Thank you for reply.

Edit:
Now its working with version react-native-sha256@1.3.6
Code:
import * as sha256 from 'react-native-sha256'
await sha256.sha256(pin).then( ( hash: any ) => { ..... });

same issue @KeiShadow which solution did you choose?

@KeiShadow I'm having this issue here. Did you solved it?

I had to move off of this library when I migrated my React Native project to TypeScript. I ended up using jsSHA with its DefinitelyTyped definitions. It works just fine in React Native with TS. It probably isn't as fast as this library, but for my usage, speed isn't important.

Yes im using this version: react-native-sha256@1.3.6.
And when you want used sha256:
import * as sha256 from 'react-native-sha256'
await sha256.sha256(pin).then( ( hash: any ) => { ..... });