UNPKG

535 BPlain TextView Raw
1import type { ReactotronCore, Plugin } from "reactotron-core-client"
2import { NativeModules } from "react-native"
3
4const devTools = () => () => {
5 return {
6 onCommand: (command) => {
7 if (command.type !== "devtools.open" && command.type !== "devtools.reload") return
8
9 if (command.type === "devtools.open") {
10 NativeModules.DevMenu.show()
11 }
12
13 if (command.type === "devtools.reload") {
14 NativeModules.DevMenu.reload()
15 }
16 },
17 } satisfies Plugin<ReactotronCore>
18}
19
20export default devTools