GithubHelp home page GithubHelp logo

Unknown component? about react-devtools HOT 6 CLOSED

facebook avatar facebook commented on April 19, 2024 1
Unknown component?

from react-devtools.

Comments (6)

vjeux avatar vjeux commented on April 19, 2024 5

You can add displayName: 'myComponent' inside of the second property to see it in the dev tools.

When you use JSX, we transform

var anotherComponent = React.createClass({

into

var anotherComponent = React.createClass({displayName: 'anotherComponent',

behind the scenes.

We don't currently infer the construct

var myComponent = (function() {
  return React.createClass({ /* ... */ })
})();

If it becomes a common pattern we could do it

from react-devtools.

josebalius avatar josebalius commented on April 19, 2024

Thanks @vjeux that did the trick.

Jose

from react-devtools.

vjeux avatar vjeux commented on April 19, 2024

Yay! Great work on ngReactGrid btw :)

from react-devtools.

josebalius avatar josebalius commented on April 19, 2024

@vjeux Thanks! I'm happy with the outcome (especially performance), and I continue to enjoy working with React the more functionality I add. It's too easy I tell ya!

from react-devtools.

kylesuss avatar kylesuss commented on April 19, 2024

Came here after reading the tutorial on the react site. I am not using JSX and the site did not show the displayName attribute being set in the translation. They do have it in the updated docs on master though, so it would seem as though the site has not yet been updated.

from react-devtools.

sophiebits avatar sophiebits commented on April 19, 2024

We'll update the site in the next few days.

from react-devtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.