Skip to content

Commit

Permalink
Migrate rn-tester/IntegrationTests/GlobalEvalWithSourceUrlTest.js to …
Browse files Browse the repository at this point in the history
…function components (facebook#48695)

Summary:

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152232
  • Loading branch information
fabriziocucci authored and facebook-github-bot committed Jan 15, 2025
1 parent e7378f0 commit 1369623
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions packages/rn-tester/IntegrationTests/GlobalEvalWithSourceUrlTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

import type {ExtendedError} from 'react-native/Libraries/Core/ExtendedError';

const React = require('react');
const ReactNative = require('react-native');
const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
const {View} = ReactNative;
import * as React from 'react';
import {useEffect} from 'react';
import {NativeModules, View} from 'react-native';
import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';

const {TestModule} = ReactNative.NativeModules;
const {TestModule} = NativeModules;

class GlobalEvalWithSourceUrlTest extends React.Component<{...}> {
componentDidMount(): void {
function GlobalEvalWithSourceUrlTest(): React.Node {
useEffect(() => {
if (typeof global.globalEvalWithSourceUrl !== 'function') {
throw new Error(
'Expected to find globalEvalWithSourceUrl function on global object but found ' +
Expand Down Expand Up @@ -75,13 +75,9 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> {
);
}
TestModule.markTestCompleted();
}
}, []);

render(): React.Node {
return <View />;
}
return <View />;
}

GlobalEvalWithSourceUrlTest.displayName = 'GlobalEvalWithSourceUrlTest';

module.exports = GlobalEvalWithSourceUrlTest;
export default GlobalEvalWithSourceUrlTest;

0 comments on commit 1369623

Please sign in to comment.