facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
229.84k stars 47.06k forks source link

Bug: DevTools 6.0.0 element inspector not working with React Native 0.75 #31112

Open tsdevshop opened 2 months ago

tsdevshop commented 2 months ago

React version: 18.3.1

React Native version: 0.75.3

Steps To Reproduce

  1. Create a new 'frameworkless' React Native app, by following these instructions. Alternatively, clone this repo, which is the result of scaffolding a new RN project.
  2. Run npm install and cd ios; bundle exec pod install to install dependencies.
  3. Run npm start in one terminal to start the Metro bundler, and npm run ios in another to build and run the app on a simulator.
  4. Run npx react-devtools@6.0.0.
  5. In the simulator, reload the app and toggle the Element Inspector.
  6. Tap on an element in the app to inspect it.

Link to code example: https://github.com/tsdevshop/react-native-devtools-test

The current behavior

The expected behavior

Note that running npx react-devtools@5.3.1 results in the correct behavior.

Screencasts

https://github.com/user-attachments/assets/89cb0446-fbbe-4b74-b989-c07a86bc4262

https://github.com/user-attachments/assets/4517c28a-c9b2-4b58-80c4-e6b3ff17a181

hcbylmz commented 1 month ago

I can confirm for React Native 0.73.6.

xiangjiu0918 commented 1 week ago

DevTools 6.3.1 element inspector not working with React Native 0.73 too