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

Obtain Variable name for Hook #71

Closed
saphal1998 opened this issue Oct 22, 2020 · 0 comments
Closed

Obtain Variable name for Hook #71

saphal1998 opened this issue Oct 22, 2020 · 0 comments

Comments

@saphal1998
Copy link
Member

Main Issue: #38

The Devtools backend returns the following element response as a part of the InspectedElement message call

const inspectedElement = {"canEditFunctionProps":true,"canEditFunctionPropsDeletePaths":true,"canEditFunctionPropsRenamePaths":true,"canEditHooks":true,"canEditHooksAndDeletePaths":true,"canEditHooksAndRenamePaths":true,"canToggleSuspense":true,"canViewSource":true,"hasLegacyContext":false,"id":3,"key":null,"rendererPackageName":"react-dom","rendererVersion":"17.0.1","rootType":"createLegacyRoot()","source":{"fileName":"/Users/saphal/Developer/personal/sample-app/src/App.js","lineNumber":28,"columnNumber":9},"type":5,"owners":[{"displayName":"App","id":2,"type":5,"hocDisplayNames":null}],"context":null,"hooks":[{"id":0,"isStateEditable":true,"name":"State","value":0,"subHooks":[]}],"props":{},"state":null}

The fileName, lineNumber and columnNumber property suggest that the Devtools backend has access to the source map. This implies that it might be possible to obtain the variable name here.

NOTE: This issue is a big one! 🐳 We need to break this down further.

@saphal1998 saphal1998 added this to the Fellowship - Fall 2020 milestone Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant