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

Namespaced components don't appear #27

Closed
kendagriff opened this issue Mar 6, 2014 · 8 comments
Closed

Namespaced components don't appear #27

kendagriff opened this issue Mar 6, 2014 · 8 comments

Comments

@kendagriff
Copy link

When I namespace my components, the devtools can't find them. Furthermore, they appear to have meaningless data-reactids (".0.0.0.0"). Example:

Game.Views.Page = React.createClass({
  render: function() {
    return (
      <section className="page">Hello, World</section>
    );
  }
});

I reference my component using Game.Views.Page(). Is JSX responsible for producing meaningful information for the devtools? Is there no way to reference namespaced components using JSX?

@sophiebits
Copy link
Contributor

Are you using jsx from React 0.9? It should set the displayName property appropriately.

@kendagriff
Copy link
Author

I'm using JSX for mimicking HTML, but as I understand it, JSX cannot take nested object names for components, right?

@sophiebits
Copy link
Contributor

The JSX compiler transforms your original code into

Game.Views.Page = React.createClass({displayName: 'Page',
  render: function() {
    return (
      React.DOM.section( {className:"page"}, "Hello, World")
    );
  }
});

The displayName property allows the dev tools to show the right component name.

@sophiebits
Copy link
Contributor

There's currently no way to use a namespaced component from JSX without bringing it into local scope though. See facebook/react#760 for some discussion on this.

@kendagriff
Copy link
Author

Thanks, Ben. I hope they introduce that.

Yes, it's adding the displayName property, however, the React tab in Chrome
DevTools is still as empty as can be. Am I missing something obvious?

On Thu, Mar 6, 2014 at 12:18 PM, Ben Alpert notifications@github.comwrote:

There's currently no way to use a namespaced component from JSX without
bringing it into local scope though. See facebook/react#760https://github.com/facebook/react/pull/760for some discussion on this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-36925395
.

Kendall
Co-Founder, Banzai
kendall@teachbanzai.com | 435.503.1462

@sophiebits
Copy link
Contributor

See https://github.com/facebook/react-devtools#the-react-tab-is-blank -- does that solve your problem?

@jaredly
Copy link
Contributor

jaredly commented Jun 18, 2015

Is this still an issue?

@kassens
Copy link
Member

kassens commented Sep 13, 2015

Please open a new issue if this is still a problem. We've since launched a new version of the devtools on the Chrome store (it should've auto-updated already).

@kassens kassens closed this as completed Sep 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants