Description
What feature would you like to see?
I understand that Firebase is implementing a method to automatically sample screentraces per-screen like Fragment on Android or ViewController on iOS. However, this isn't good enough for cross platform frameworks like React Native which runs in one fragment of one activity. Screens in React Native are sometimes a bunch of components nested in an RCTView (or its equivalent Android abstraction). Thus in React Native it's actually preferential to be able to start and stop a screentrace on demand, because the native code does not know when a React Native screen has mounted. Could the ScreenTrace API be provided on an ad hoc basis with start/stop methods? Could the Fragment based workflow be shut off so we can instrument our own ScreenTrace?
How would you use it?
- React Native App starts
- developer calls
ScreenTrace.start('StartScreen')
- the user navigates to the next React Native screen
- developer calls
ScreenTrace.stop('StartScreen')
andScreenTrace.start('MySecondScreen')
Like in previous versions, a screentrace is always running but now the developer has fine tuned control over when to start and stop the screen trace and what name to give it.
Big thanks to @mikehardy for helping me triage this issue in RN