Skip to content

Extensible React Native Devtools compatible with both Expo and bare RN.

License

Notifications You must be signed in to change notification settings

DorianMazur/rn-devtools

Repository files navigation

React Native Devtools

Sleek, extensible devtools for React Native. Add tabs as npm plugins!

alt text

✨ Highlights

  • Plugin system: add tabs via simple npm packages.
  • Real-time monitoring (Socket.IO integration for reliable communication)
  • Zero server edits: plugins talk over a shared plugin:up / plugin:down bus.
  • One hook to wire it all: useReactNativeDevtools() creates one socket, fans out to plugin hooks.
  • Always listening: plugins keep syncing even when their tab isn’t active.
  • Zero-config production safety - automatically disabled in production builds

🚀 Quick start

Installation

1. Install (in your RN app)

yarn add -D rn-devtools
yarn add @rn-devtools/plugin-sdk

2. (Optional) Install plugins

3. Tell the web app which plugins to load

Create rn-devtools.config.js in your RN app:

module.exports = {
  plugins: [
    "@rn-devtools/react-query-plugin",
    "@rn-devtools/react-navigation-plugin",
    "@rn-devtools/react-native-mmkv-plugin"
  ],
};

4. Start the DevTools

# from the package root
rn-devtools

5. Wire the RN app (one hook, many plugins)

import { useReactNativeDevtools } from "rn-devtools";
import { useReactQueryDevtools } from "@rn-devtools/react-query-plugin/native";
import { useReactNavigationDevtools } from "@rn-devtools/react-navigation-plugin/native";
import { seMMKVDevtools } from "@rn-devtools/react-native-mmkv-plugin/native";

function App() {
  // your app setup…
  useReactNativeDevtools({
    socketURL: "http://10.0.2.2:35515",
    deviceName: Platform.OS,
    platform: Platform.OS,
    deviceId: Platform.OS, // make this persistent per device in real apps
    plugins: ({ socket, deviceId }) => {
      useReactQueryDevtools({ queryClient, socket, deviceId });
      useReactNavigationDevtools({ navigationRef, socket, deviceId });
      useMMKVDevtools({ storages: [storage], socket, deviceId, });
    },
  });

  return <AppRoot />;
}

DevTools opens on http://localhost:35515

License

This project is licenced under the MIT License.

About

Extensible React Native Devtools compatible with both Expo and bare RN.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •