I'm trying to make use of the sodium-plus
and libsodium-wrappers
libraries to create a custom React hook that will enable me to use some crypto functionality.
The trouble is I'm getting all confused in the world of async/await and I really need a second pair of eyes to tell me where I'm going wrong !
Sample code: https://codesandbox.io/s/old-sunset-4mnh8
As you can see the useEncryption()
custom React hook is called in App.js
but I can't make use of the result. I have tried refactoring my code in endless ways but I'm just getting increasingly confused and frustrated.
Would appreciate the assistance. Thanks.