diff --git a/src/components/CustomDevMenu/index.js b/src/components/CustomDevMenu/index.js deleted file mode 100644 index b8944c185d13..000000000000 --- a/src/components/CustomDevMenu/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const CustomDevMenu = () => {}; - -CustomDevMenu.displayName = 'CustomDevMenu'; - -export default CustomDevMenu; diff --git a/src/components/CustomDevMenu/index.native.js b/src/components/CustomDevMenu/index.native.js deleted file mode 100644 index c8d0e1e099d4..000000000000 --- a/src/components/CustomDevMenu/index.native.js +++ /dev/null @@ -1,15 +0,0 @@ -import {useEffect} from 'react'; -import DevMenu from 'react-native-dev-menu'; -import toggleTestToolsModal from '@userActions/TestTool'; - -function CustomDevMenu() { - useEffect(() => { - DevMenu.addItem('Open Test Preferences', toggleTestToolsModal); - }, []); - - return null; -} - -CustomDevMenu.displayName = 'CustomDevMenu'; - -export default CustomDevMenu; diff --git a/src/components/CustomDevMenu/index.native.tsx b/src/components/CustomDevMenu/index.native.tsx new file mode 100644 index 000000000000..d8a0ea987171 --- /dev/null +++ b/src/components/CustomDevMenu/index.native.tsx @@ -0,0 +1,18 @@ +import {useEffect} from 'react'; +import DevMenu from 'react-native-dev-menu'; +import toggleTestToolsModal from '@userActions/TestTool'; +import CustomDevMenuElement from './types'; + +const CustomDevMenu: CustomDevMenuElement = Object.assign( + () => { + useEffect(() => { + DevMenu.addItem('Open Test Preferences', toggleTestToolsModal); + }, []); + return <>; + }, + { + displayName: 'CustomDevMenu', + }, +); + +export default CustomDevMenu; diff --git a/src/components/CustomDevMenu/index.tsx b/src/components/CustomDevMenu/index.tsx new file mode 100644 index 000000000000..8384a9804fb4 --- /dev/null +++ b/src/components/CustomDevMenu/index.tsx @@ -0,0 +1,5 @@ +import CustomDevMenuElement from './types'; + +const CustomDevMenu: CustomDevMenuElement = Object.assign(() => <>, {displayName: 'CustomDevMenu'}); + +export default CustomDevMenu; diff --git a/src/components/CustomDevMenu/types.ts b/src/components/CustomDevMenu/types.ts new file mode 100644 index 000000000000..bdfc800a17f0 --- /dev/null +++ b/src/components/CustomDevMenu/types.ts @@ -0,0 +1,8 @@ +import {ReactElement} from 'react'; + +type CustomDevMenuElement = { + (): ReactElement; + displayName: string; +}; + +export default CustomDevMenuElement;