@traun/react-native
v0.1.12
Published
React Native client SDK for Traun debugger (Expo Go & bare RN)
Downloads
1,908
Maintainers
Readme
@traun/react-native
JS-only client SDK for the Traun React Native debugger. Works with Expo Go, expo run:android/ios, and bare React Native — no native modules.
Install
npm install @traun/react-nativeUsage
In your app entry (index.js, App.tsx, or app/_layout.tsx):
import { Image, Platform } from 'react-native';
import { startTraun } from '@traun/react-native';
if (__DEV__) {
startTraun({
appName: 'MyApp',
platform: Platform.OS === 'ios' ? 'ios' : 'android',
// optional — shows in Traun Devices panel
appIcon: Image.resolveAssetSource(require('./assets/icon.png')).uri,
});
}Console Location (file:line in Traun Logs)
Hermes stacks usually resolve every console.log to the bundle entry (index.js). For real filenames, add the Traun Babel plugin:
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'], // or your existing presets
plugins: [
'@traun/react-native/babel', // add this
// ...your other plugins
],
};
};Then reset Metro cache and reload:
npx react-native start --reset-cache
# or: npx expo start -c- Open the Traun desktop app (or VS Code extension).
- Reload your RN app.
- You should see the device in Traun and Metro logs like
[traun] connecting….
USB Android: keep USB debugging on; Traun desktop auto-runs adb reverse for port 9485 when adb is available.
