Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Conversation

@bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jan 2, 2019

Follow up for something I noticed while testing #1258

Inspecting props/state within the Profiler never worked right because React mutates fibers, so older "snapshots" of props/state can't be inspected. However the UI seemed to suggest that props could be expanded– which was confusing.

This changes things to make the UI more intuitive. For example, the state.object object below doesn't show a carrot or mouse pointer cursor for inspecting.

Here's the Elements panel style:
screen shot 2019-01-02 at 2 53 57 pm

And here's the Profiler panel style:
screen shot 2019-01-02 at 2 54 10 pm

I also changed the DataView component displayed inside of the profiler to expand objects by default up until the point where they're dehydrated, to offset the fact that we don't allow you to toggle them expanded/collapsed any more.


inspect() {
if (this.props.inspect === null) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth commenting why this is useful. Someone later might look at this code and think: "I'll just simplify this by passing an empty function!"

@bvaughn bvaughn merged commit 17d5523 into facebook:master Jan 2, 2019
@bvaughn bvaughn deleted the Profiler-dont-inspect branch January 2, 2019 23:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants