When writing a React Native app, I often find myself in a need of a native functionality. Now, if you are like me, the first thing you do is go over to
Bridge can be overloaded
Most of the time people don’t care about how many and how often they’re passing data to the bridge, which might be a cause of an overload. When the bridge is overloaded, your application will tend to freeze, which happens to be a very frequent case. Personally, I always aim at sending as little data as possible because of potential performance issues and I would recommend you to do the same. Otherwise…
Debug with MessageQueue
There is no need to be worried though, let me show you how to check how much data is being passed to the bridge. All you need to do is import
MessageQueue from a weird path
react-native/Libraries/BatchedBridge/MessageQueue.js and add a
When you add this to your application, you’ll see something like the above in your console.
I hope that I’ve managed to help you understand how to debug the bridge in your native module and that now you’ll be able to do it yourself.
Thank you for your time!