Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

require('react-native').NativeModules is an empty object

In one of the node_modules that I'm using in my project at the top of the file it says:

let RNRandomBytes = require('react-native').NativeModules.RNRandomBytes

Unfortunately, it appears that require('react-native').NativeModules is an empty object {}. How can I proceed from here?

The package that I'm trying to use is: 'react-native-secure-randombytes'.

If anyone has experience with this I'd really appreciate it.

Thanks

like image 568
SwimmingG Avatar asked May 15 '26 22:05

SwimmingG


1 Answers

You can use this way may be it help you

import {NativeModules} from 'react-native';
like image 121
Hermenpreet Singh Avatar answered May 18 '26 10:05

Hermenpreet Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!