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

Conversation

@gaearon
Copy link
Contributor

@gaearon gaearon commented Jan 17, 2019

Fixes #1142, #645, #929. This is a minimally invasive fix.

Before:

screen shot 2019-01-17 at 9 55 52 pm

screen shot 2019-01-17 at 9 55 49 pm

After:

screen shot 2019-01-17 at 9 56 24 pm

Kinda works with Hooks too:

screen shot 2019-01-17 at 9 56 49 pm

For Hooks state, this exposes our internal implementation but I think it's better than nothing if you're debugging. We can later improve it to flatten the list into an array or even show a tree representation.

I made it a fallback and not just for functions in case you want to inspect props of some exotic type. I see nothing wrong with that.

(I also used this as an opportunity to make it work for text nodes too.)

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

I think this change looks safe 👍 😄

@Jessidhia
Copy link

How come I missed this this is brilliant 🎉

Gone will be the days where I literally go spelunking around __reactInternalFiber's children / next / returns to be able to look at a component's relevant fiber state

@gaearon
Copy link
Contributor Author

gaearon commented Jan 19, 2019

You and me, @Jessidhia, you and me.

@gaearon
Copy link
Contributor Author

gaearon commented Jan 19, 2019

(On the other hand, isn't it a nice primer to React internal data structure? 😆)

@yfain
Copy link

yfain commented May 17, 2019

I'm using version 3.6 of this extension in Chrome, but the issue is still there, e.g. $r is not defined for functional components. Is there a newer build of this extension that includes this fix?

@bvaughn
Copy link
Contributor

bvaughn commented May 17, 2019

@yfain This version of the extension isn't getting a lot of focus right now, because we're trying to finish up and release the new one. I'd suggest just hopping on the beta train for that one 😄

https://github.com/bvaughn/react-devtools-experimental#installation

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.

$r doesn't highlight Stateless Functional Components

6 participants