Skip to content

Commit cb7dd1f

Browse files
authored
feat(boilerplate): Adds custom command for reactotron to show the react native dev menu. (#2541)
1 parent 38f1af2 commit cb7dd1f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

boilerplate/app/devtools/ReactotronConfig.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* free desktop app for inspecting and debugging your React Native app.
44
* @see https://github.com/infinitered/reactotron
55
*/
6-
import { Platform } from "react-native"
6+
import { Platform, NativeModules } from "react-native"
77

88
import AsyncStorage from "@react-native-async-storage/async-storage"
99
import { ArgType } from "reactotron-core-client"
@@ -46,6 +46,17 @@ if (Platform.OS !== "web") {
4646
* NOTE: If you edit this file while running the app, you will need to do a full refresh
4747
* or else your custom commands won't be registered correctly.
4848
*/
49+
50+
Reactotron.onCustomCommand({
51+
title: "Show Dev Menu",
52+
description: "Opens the React Native dev menu",
53+
command: "showDevMenu",
54+
handler: () => {
55+
Reactotron.log("Showing React Native dev menu")
56+
NativeModules.DevMenu.show()
57+
},
58+
})
59+
4960
Reactotron.onCustomCommand({
5061
title: "Reset Root Store",
5162
description: "Resets the MST store",

0 commit comments

Comments
 (0)