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

Show troubleshooting tab if React cannot be found #53

Closed
appsforartists opened this issue Nov 12, 2014 · 3 comments
Closed

Show troubleshooting tab if React cannot be found #53

appsforartists opened this issue Nov 12, 2014 · 3 comments

Comments

@appsforartists
Copy link

Right now, if RDT doesn't think your page is Reactful, it will not draw the tab at all.

(Moreover, the best-practice of using webpack/browserify to load React will fail RDT's "is this page Reactful?" test, so the React tab will never draw.)

I propose that the React tab is always present. If RDT doesn't think the page is Reactful, it will say something to the effect of:

Sorry, but we couldn't find an instance of React on this page.

Make sure it has been exposed as window.React, then reload.
If you are sure it has been exposed at window.React and you are still seeing this message, [Click here] and we'll double-check.

[Click here] will try to load RDT again without reloading the page (in case there's a race condition that's preventing RDT from seeing React).

@appsforartists
Copy link
Author

It also seems like the handoff between React and RDT should be smarter than if (window.React). If, for instance, React.renderComponent attempted to connect to the dev tools, you should avoid most cases where the dev tools are installed but don't render. Those that do occur would be easy to solve (call renderComponent again).

@sophiebits
Copy link
Contributor

As of React 0.12, React does connect to the dev tools and shouldn't require exporting window.React. (Looks like the README should be updated…)

@appsforartists
Copy link
Author

Upgrading to 0.12 fixed this for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants