Skip to content

Commit

Permalink
feat(boilerplate): Adds custom command for reactotron to show the rea…
Browse files Browse the repository at this point in the history
…ct native dev menu.
  • Loading branch information
markrickert committed Nov 1, 2023
1 parent 38f1af2 commit 63b1003
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion boilerplate/app/devtools/ReactotronConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* free desktop app for inspecting and debugging your React Native app.
* @see https://github.com/infinitered/reactotron
*/
import { Platform } from "react-native"
import { Platform, NativeModules } from "react-native"

import AsyncStorage from "@react-native-async-storage/async-storage"
import { ArgType } from "reactotron-core-client"
Expand Down Expand Up @@ -46,6 +46,17 @@ if (Platform.OS !== "web") {
* NOTE: If you edit this file while running the app, you will need to do a full refresh
* or else your custom commands won't be registered correctly.
*/

Reactotron.onCustomCommand({
title: "Show Dev Menu",
description: "Opens the React Native dev menu",
command: "showDevMenu",
handler: () => {
Reactotron.log("Showing React Native Dev menu")
NativeModules.DevMenu.show()
},
})

Reactotron.onCustomCommand({
title: "Reset Root Store",
description: "Resets the MST store",
Expand Down

0 comments on commit 63b1003

Please sign in to comment.