Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - how to inspect the UI/ elements?

I have installed the react dev tool. But I can't see it my Chrome browser when I launch my app on the emulator.

enter image description here

If you watch this youtube clip, you can see the react tab is in the list and you can inspect your app's UI.

Any idea why?

How can I inspect the app's UI/ elements if the react dev tool is not working on my Chrome?

like image 952
Run Avatar asked Apr 15 '16 04:04

Run


People also ask

How do I inspect UI in React Native?

To inspect elements, open your app in Simulator > press Cmd+D > select Show Inspector. Save this answer. Show activity on this post. Save this answer.

Can we inspect element on React Native?

Run your app in the simulator, and enable the React Native UI Inspector in Nuclide using the command palette. Now, if you enable the UI Inspector in the simulator, it'll highlight the elements in your simulator UI inside Nuclide.

How do you debug layout in React Native?

Debugging React Native AppsPress Command + D and a webpage should open up at http://localhost:8081/debugger-ui. (Chrome only for now) or use the Shake Gesture. Enable Pause On Caught Exceptions for a better debugging experience.

How do I check my console in React Native?

Just run react-native log-ios or react-native log-android on the command line inside your project folder. And when you open the Remote JS Debugging, you have to press option+command+i and check the console.


2 Answers

Devtools "React" is currently not possible. This is due to a change in how the application scripts are evaluated in the devtools plugin. You can see more at https://facebook.github.io/react-native/docs/known-issues.html#devtools-react-tab-does-not-work

However, you can still debug your UI within your application. To inspect elements, open your app in Simulator > press Cmd+D > select Show Inspector.

like image 59
DoanND Avatar answered Sep 27 '22 02:09

DoanND


Step 1: Install the react-devtools package globally using this command : npm install -g react-devtools

Step 2: Goto your Project Directory and run project

Step 3: Open other command prompt and goto at Project Directory and run following command react-devtools

Step 4: It will open "React Developer Tools"

Step 5: Now at Emulator press Ctrl+M and select Toggle Inspector

Step 6: Now you can inspect in React Developer Tools

for more information go at https://facebook.github.io/react-native/docs/debugging.html#react-developer-tools

React Developer Tools

like image 40
Jitendra Suthar Avatar answered Sep 26 '22 02:09

Jitendra Suthar