1

I want to generate mnemonics in React Native. I have cloned this project. I imported bip39 but I am getting this error in mobile/simulator. Works fine in debug mode in Chrome browser.

library Error: Secure random number generation is not supported by this browser

I installed bip39 react native library. But when I use that module app is not opening and gets stuck in the splash screen. I tried to use other libraries like bit core bip39, but every lib has the same problem.

How can I create mnemonics in React Native using the above repository which I cloned React Native web3 boiler plate?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Trinu
  • 1,721
  • 3
  • 21
  • 41
  • I have updated the answer here https://ethereum.stackexchange.com/questions/61306/how-to-generate-mnemonics-from-randombytes – Trinu Nov 01 '18 at 16:13

2 Answers2

2

I generated the memonic using @medardm/react-native-bip39 on React Native project.

tomato
  • 153
  • 2
  • 10
0

Working with web3 in react-native i faced this issue a few. You are probably using the bip39 node.js package. The output you get means that is using a browser library that is not present in react-native(it is probably added as dependency in node). What you should use is bip39 for react native, here is a link to it.

nikos fotiadis
  • 1,040
  • 2
  • 8
  • 16