3

I am using React Native context to pass data from a simple react-native-ble-plx script to different screens in my app. I'm using react-native-navigation for these screens. Whenever I call navigation.navigate(), I successfully navigate to another screen, but I no longer have bluetooth communication, even if I navigate back to the original screen. How do I keep sending data from my BLE context to the different screens in my app, without disconnecting?

2 Answers2

1

I believe that this is happening because you are handling/monitoring the connection on the page instead of doing it via a service. Separating BLE functionality from the UI should fix this issue. Have a look at the links below for more information:-

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
0

This is not really a "solution" but I solved this problem by removing React Navigation from my project, and just handling the screens manually like this:

<View>
  {showScreen1 && <View></View>} 
  {showScreen2 && <View></View>}
</View>