-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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
DevTools: Ability to save inspected values as global variable (as it was in previous version) #16541
Comments
Maybe values in the tree could have a "bug" button next to them too that appears only on hover. |
See issue #16428 I don't personally think this needs to be a top level button. You can still store global vars using the console itself and the existing UI: |
This is a little tricky in some edge cases (really close to the right/left side) and probably not the greatest in terms of accessibility (although we have a lot of areas we could stand to improve on in this regard). |
@
Hi @bvaughn, the problem in this flow is that you need to do 3 steps:
|
It's slightly more clicks (3 vs 2) but I don't think that necessarily means we need to change it. I don't think this is a very common interaction, and screen real estate is pretty precious in a DevTools. |
I think @AkhmedovValikhan's point is that usually you start inspecting props/state inline, get to some nested field, and then realize you want to save it. So it's not just one click more; you have to redo the whole "find the nested field" thing after logging. |
+1 this feature was very helpful for debugging in the previous version. Now debugging at run time takes longer and is less intuitive.
This feature was in the context menu, so how does it affects screen real estate? |
Moreover, it seems like you can't make a context item a global any more. With the new bug icon, it logs out props, state, and nodes; but not context. |
@pauls-ai2 For class components, For function components ( |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
Hi, I really like new dev tools (4.0.5), but I would like to request one useful feature.
In previous version it was possible to save inspected value (prop/state/context) and its parts as a global variable using context menu->store as global variable, so it can be easily be accessed through console using
$tmp{n}
. In current version this is behaviour was replaced be creating new "bug" button which will just print all values in console. Unfortunately it's hard to navigate through this object, because $_ in console will return undefined. And in order to access it you need to expand group, find desired property and open context menu->store as global variable.It would be perfect if you combine these 2 approaches so it would be possible to both print values using "bug" button and opening context menu directly in react dev tools panel wihtout need of intermediate step.
Thanks!
The text was updated successfully, but these errors were encountered: