I am building a react native app with expo. I want to use superjson
to encode and decode data for async-storage
but when I import it, I get this error:
Unable to resolve "superjson" from "path/to/my-file.ts"
I downloaded it via yarn
:
yarn add superjson
and I imported like this:
import SuperJSON from "superjson"
EDIT:
it works when import it like this:
import SuperJSON from "superjson/dist/index"
but I still don't understand why it doesn't work without /dist/index
and how can I fix it