-
Notifications
You must be signed in to change notification settings - Fork 49.6k
[DevTools] Hide State and Props in the Sidebar for Suspense #34630
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
Conversation
ce663d7
to
c008799
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "children" and "fallback" props are just the thing that you can see in the tree view anyway.
You'd have to suspend to see the fallback. The components tree only gives you the parent tree not what the actual children were for this Suspense.
State I can get behind even though I wanted to show if boundaries are still dehydrated. Props of Suspense I used plenty and doesn't warrant removal IMO.
This PR also assumes that inspected element and tree are next to each other. That may be the case for the Components tab (if scroll is aligned). But not for the Suspense tab. Even in the Components tab it requires effort to line up the inspected element pane with the selected element in the tree which is quite busy.
I could get behind showing it in the Components tab but it's just too much for the Suspense tab which means you'd have to switch anyway. The important bit is what suspended and who rendered it and I need to be able to get to the "who rendered it link" below too. If it's below the "rendered by" then it's too hard to scroll to the bottom. If it's above, then falls below the fold in the simple cases where we could just show it all on screen. The thing is that I recently just added formatting of the children anyway so until recently it was super hard to use the children props for anything it due to the poor formatting anyway. I've never used it. It seems like such an edge case for normal use that it's ok to hide it behind some steps. |
Even if we add it back in some form later, I don't want it there now for the initial introduction to this tool. |
We can already see this state and switch its state in the toolbar.
5695fdc
to
750c38e
Compare
We're showing too much noise in the side-panel when selecting a Suspense boundary. The interesting thing to see directly is the "Suspended by".
The "props" are mostly useless because the
"name"
prop is already in the tree. I'm now also showing it in the title bar of the selected element panel. The "children" and "fallback" props are just the thing that you can see in the tree view anyway.The "state" is this weird section with just one field in it, which we already have duplicated in the top toolbar as well. We can just delete this. I make sure to show the icon and a "suspended..." section while the boundary is still loading but now yet resuspended by force suspending.
While still loading:
After loading:
Resuspended after loading: