Skip to content

Commit cf3542d

Browse files
committed
Use invalidate instead of deprecated onCatalystInstanceDestroyed and add missing method from spec
1 parent 83cef16 commit cf3542d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ public String getName() {
130130
return PERFORMANCE_MODULE;
131131
}
132132

133+
@Override
134+
public void addListener(String eventName) {
135+
136+
}
137+
138+
@Override
139+
public void removeListeners(double count) {
140+
141+
}
142+
133143
private void emitNativeStartupTime() {
134144
safelyEmitMark(new PerformanceMark("nativeLaunchStart", StartTimeProvider.getStartTime()));
135145
safelyEmitMark(new PerformanceMark("nativeLaunchEnd", StartTimeProvider.getEndTime()));
@@ -216,14 +226,9 @@ public void logMarker(PerformanceEntry entry) {
216226
}
217227

218228
@Override
219-
public void onCatalystInstanceDestroy() {
220-
super.onCatalystInstanceDestroy();
229+
public void invalidate() {
230+
super.invalidate();
221231
RNPerformance.getInstance().removeListener(this);
222232
ReactMarker.removeListener(markerListener);
223233
}
224-
225-
// Fix new arch runtime error
226-
public void addListener(String eventName) {
227-
228-
}
229234
}

0 commit comments

Comments
 (0)