EOSIO / eosjs-keygen

Javascript keys generator for EOS
71 stars 42 forks source link

React Native got error: "Browser history needs a DOM" #11

Open hzuhyb opened 6 years ago

hzuhyb commented 6 years ago

when import eosjs-keygen, i got the error: "Browser history needs a DOM"

Environment

Environment:
  OS: macOS High Sierra 10.13.1
  Node: 8.9.1
  Yarn: 0.24.5
  npm: 5.5.1

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4
wx20180616-130458 2x
jcalfee commented 6 years ago

I also hear there are some needed crypto functions that will not work with RN.

hzuhyb commented 6 years ago

@jcalfee This error may be caused by using "createBrowserHistory", use "createMemoryHistory" can fix it.

wx20180621-123818 2x
jcalfee commented 6 years ago

The code your pointing to is in browser.js .. I don't have a RN environment setup now, I will get some feedback on this and see what I can do though. I suspect there are going to be many changes for RN.

jcalfee commented 6 years ago

The best thing for you may be to fork this repo and make the change yourself (until I have done enough research to start changing things). You'll probably uncover more issues ..

Please also make sure that this is the library you need. This is designed to derive and cache keys but also needs a password manager to store a "root" key. This library does not have secure or password protected storage. It does however figure out permission hierarchies and is configurable enough to only store keys you feel are safe to store.

hzuhyb commented 6 years ago

Thank you for your reply.