-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29744 from software-mansion-labs/ts-migration/cus…
…tom-dev-menu-component [TS migration] Migrate 'CustomDevMenu' component to TypeScript
- Loading branch information
Showing
5 changed files
with
31 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import CustomDevMenuElement from './types'; | ||
|
||
const CustomDevMenu: CustomDevMenuElement = Object.assign(() => <></>, {displayName: 'CustomDevMenu'}); | ||
|
||
export default CustomDevMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {ReactElement} from 'react'; | ||
|
||
type CustomDevMenuElement = { | ||
(): ReactElement; | ||
displayName: string; | ||
}; | ||
|
||
export default CustomDevMenuElement; |