diff --git a/packages/rn-tester/IntegrationTests/SimpleSnapshotTest.js b/packages/rn-tester/IntegrationTests/SimpleSnapshotTest.js
index 347de5c815d..b26b540d590 100644
--- a/packages/rn-tester/IntegrationTests/SimpleSnapshotTest.js
+++ b/packages/rn-tester/IntegrationTests/SimpleSnapshotTest.js
@@ -10,32 +10,29 @@
'use strict';
-const React = require('react');
-const ReactNative = require('react-native');
+import * as React from 'react';
+import {useEffect} from 'react';
+import {NativeModules, StyleSheet, View} from 'react-native';
-const {StyleSheet, View} = ReactNative;
-const {TestModule} = ReactNative.NativeModules;
+const {TestModule} = NativeModules;
-class SimpleSnapshotTest extends React.Component<{...}> {
- componentDidMount(): void {
+function SimpleSnapshotTest(): React.Node {
+ const done = (success: boolean) => {
+ TestModule.markTestPassed(success);
+ };
+ useEffect(() => {
if (!TestModule.verifySnapshot) {
throw new Error('TestModule.verifySnapshot not defined.');
}
- requestAnimationFrame(() => TestModule.verifySnapshot(this.done));
- }
+ requestAnimationFrame(() => TestModule.verifySnapshot(done));
+ }, []);
- done: (success: boolean) => void = (success: boolean) => {
- TestModule.markTestPassed(success);
- };
-
- render(): React.Node {
- return (
-
-
-
-
- );
- }
+ return (
+
+
+
+
+ );
}
const styles = StyleSheet.create({
@@ -57,6 +54,4 @@ const styles = StyleSheet.create({
},
});
-SimpleSnapshotTest.displayName = 'SimpleSnapshotTest';
-
-module.exports = SimpleSnapshotTest;
+export default SimpleSnapshotTest;