Reputation: 154954
When debugging a React website, I can view the component hierarchy using the React Developer Tools:
How can I do the same in React Native? The rage shake menu contains an 'inspector' but it only seems to let me inspect a single element by tapping it - I don't see any way to browse the full component hierarchy.
Upvotes: 6
Views: 4184
Reputation: 5659
This works for me using the standalone react-devtools app with React Native 0.55.
npm install -g react-devtools
react-devtools
Upvotes: 1
Reputation: 6524
Unfortunately, since version 0.12 of react-native, the Devtools "React" Tab does not work anymore. It's a known issue.
There's a quite active discussion on Github that has been open for a while, but no solutions yet.
UPDATE
The Devtools "React" tab still don't work in Chrome, but the latest Nuclide has it built in! (It's an IDE built on top of Atom).
With Atom installed with the Nuclide package, start your app and deactivate chrome or safari debugging.
Then, pressing Cmd+Shift+P
in Atom will trigger the command palette and you can toggle the dev tools by searching for React Native Inspector:
Upvotes: 5