Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inspect DOM tree of React Native app?

Is it possible to visually inspect the DOM tree of a React Native app, in the way you can inspect a regular Web page in Chrome's Elements panel? If so, how?

like image 618
aknuds1 Avatar asked Dec 30 '15 16:12

aknuds1


People also ask

How do you inspect React Native mobile app?

By default, React Native supports ChromeDev tools through its remote debugging capability. When your app is running on Android Emulator, press Ctrl+M on Windows or Cmd+M on Mac to access the in-app developer menu. If it's running on a real device, then you just need to shake your device.

How do I inspect element in React Native?

Approach 2: Use react-devtools This might work only with React Native 0.43 or higher. Install react-devtools as a dev dependency to your project. Run your react native app in the simulator, and open the UI Inspector. The simulator will automatically use react-devtools as the primary UI for the UI Inspector.

How do you inspect React Native app on emulator?

In App Developer Menu On Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

What is Dom in React Native?

The DOM (Document Object Model) represents the web page as a tree structure. Any piece of HTML that we write is added as a node, to this tree.


1 Answers

For something closer to Chrome DevTool's Element panel, try using react-native-debugger.

Works on: windows, osx and linux. It supports: react native and redux.

react-native-debugger preview

like image 172
bot19 Avatar answered Oct 19 '22 19:10

bot19