-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Can't print $r in console #366
Comments
On the Console section, just to the left of "Preserve log" checkbox, make sure it is selected to the page you are inspecting, which is most likely |
My version is 50.0.2661.75 (Mac). |
That fixed it @jaredly. Thanks! |
For those who are still struggling with this issue: The $r object is only accessible once the React devtool tab has been selected. |
Suggestion: from the scope of the extension itself, you could write out an instructional message when one tries to retrieve $r. Good that this is issue is present in this repository as a form of documentation / instruction anyways :) |
Great point @cveld. Now that's thinking like Elm. :) |
Closing, as the mistake is related to doing it in the wrong iframe context.
Not sure I understand how we could get access to the top-level context. Also doesn't feel right to pollute a different context than the one React app is running in. |
@gaearon It's not just the Hope it helps. EDIT: |
I'm a bit confused—what did you expect |
Well, since I am new to this, and most likely others here asking, are just like me, i supposed I think that's what people miss out when trying to access it. |
Oh, that's not what it means. It's more similar to how Chrome DevTools elements view gives you How did you learn about |
I saw it inside the Basically, I thought it might contain off-topic: any reason I am seeing all components named |
Got it! 👍
If you're not using Uglify then I don't know. Maybe you're using |
Hmm .. to be honest... maybe remove the current message from the right, add another gray divider, and write a message like I think that gives you an idea that you need to select components in order to access them via
All components are exported via |
No, that's some third party transform. I was referring to the default ones. Please provide a project reproducing the problem and file a new issue about this. |
Maybe something like this would be more descriptive ? http://i.imgur.com/8H1znGo.png LE: Just figured out the issue of |
FYI I think |
@arifmahmudrana You could simply open React DevTools and try. |
@Eduardjs I was mentioning that |
@arifmahmudrana Not true. Checking state is not the only meaning of |
@Eduardjs |
@arifmahmudrana You wrote about two different things. 1st message: My reply is entirely correct for your first message, as you mentioned one or the other, whereas in your latest reply you only mentioned "stateless functional" ( a functional component is by itself stateless, so in my opinion the naming sounds like .. a double negation ) either way, make up your mind. Just to conclude, you're wrong, both functional as well as stateless components can have methods.
Hope this clears the confusion for you 👍 |
Re: function components — we're tracking them here #645. |
This issue was resolved when I hid the console side bar. When the console side bar was open the error was $r undefined........ ???? |
You need to select the "App" component in react dev tab and then "$r" receives a value. |
Got an error message:
When I input $r in console. But I can see the state and props.
The text was updated successfully, but these errors were encountered: