1 | import type { ReactotronCore, Plugin } from "reactotron-core-client"
|
2 | import { NativeModules } from "react-native"
|
3 |
|
4 | const 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 |
|
20 | export default devTools
|