Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element inspector doesn't work in RN 74 #240

Closed
kmagiera opened this issue May 13, 2024 · 4 comments
Closed

Element inspector doesn't work in RN 74 #240

kmagiera opened this issue May 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kmagiera
Copy link
Member

This issue is to track progress on fixes necessary to get element inspector workable again after update to 0.74

The reason behind the breakage is this PR from react that removes debugSource from fiber nodes: facebook/react#28265

Despite this change not being included in any react release, it's already included in the renderer code in RN 74 and Expo 51.

@kmagiera kmagiera added the bug Something isn't working label May 13, 2024
@kmagiera
Copy link
Member Author

We tried following the approach propsed on that PR and implemented for devtools: facebook/react#28351

However, it has some serious limitations:

  1. Line/column for components only points to the code where component is defined and not where it's being used. This makes this approach useless in many situations. For example, when you render Views and Text elements in your components, and click on one of Text items, it'll only include Text from RN implementation on stack and not the place in the component when Text is used. That approach would also list the parent component that renders the Text on stack, but it'll point to its definition (first line of the component) as opposed to the place where Text element is used. This may be ok for small components, but in real-life applications it doesn't really help too much if you need to locate the actual component manually
  2. Components that doesn't take parameters don't get listed in stack. This amplifies the problem mentioned above and specifically if you use expo-router, which passes all screen params using hooks, it is quite frequent that you'll end up not getting a single component on the stack that has source pointing to a file in your app directory (rather than library files from node_modules)

@kmagiera kmagiera changed the title Eement inspector doesn't work in RN 74 Element inspector doesn't work in RN 74 May 13, 2024
@kimjisena
Copy link
Collaborator

I'm also experiencing this issue on RN 0.73.6.

@pietgk
Copy link
Collaborator

pietgk commented Jul 1, 2024

i have a working inspector in a RN 0.74.2 project with v0.0.15

@kmagiera
Copy link
Member Author

kmagiera commented Jul 5, 2024

ah, this got fixed some time ago, the issue should be closed now. Thanks

@kmagiera kmagiera closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants