diff --git a/packages/rn-tester/js/components/RNTesterButton.js b/packages/rn-tester/js/components/RNTesterButton.js index d760b3a00ea230..a53385d6f89854 100644 --- a/packages/rn-tester/js/components/RNTesterButton.js +++ b/packages/rn-tester/js/components/RNTesterButton.js @@ -12,8 +12,7 @@ import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes'; -const React = require('react'); -const {Pressable, StyleSheet, Text} = require('react-native'); +import {Pressable, StyleSheet, Text} from 'react-native'; type Props = $ReadOnly<{| testID?: string, @@ -22,17 +21,15 @@ type Props = $ReadOnly<{| onPress?: ?(event: PressEvent) => mixed, |}>; -class RNTesterButton extends React.Component { - render(): React.Node { - return ( - [styles.button, pressed && styles.pressed]}> - {this.props.children} - - ); - } +function RNTesterButton(props: Props): React.Node { + return ( + [styles.button, pressed && styles.pressed]}> + {props.children} + + ); } const styles = StyleSheet.create({ @@ -51,4 +48,4 @@ const styles = StyleSheet.create({ }, }); -module.exports = RNTesterButton; +export default RNTesterButton;