-
Notifications
You must be signed in to change notification settings - Fork 87
Loses displayName when using React.createClass #19
Comments
+1. My PropType warning also come through as 'ProxyClass' instead of the actual component |
Actually, this is resolved if I include the display-name plugin before react-transform plugin. |
Yes, this is the intended usage. PR to document this is appreciated. |
If anyone else runs into this, I was getting an error about conflicting plugins because babel was loading the
I was able to make everything run in the correct order and fixed the conflict error. |
This wasn't the case before. Are you running some new Babel version? |
It's possible. I just updated to |
Let's keep it open until we figure it out. |
@joefiorini's fix worked for me. Just add My full {
"stage": 1,
"env": {
"development": {
"plugins": ["react-transform:after"],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}
}
}
}
} |
Is this an issue again with babel 6? .babelrc:
Component:
babel src/components/Blub.jsx
package.json
|
I'm using Babel 6 with a similar set up to @rubengrill, however the |
I've got the same error as @rubengrill - this doesn't show my the displayName {
"presets": ["react", "es2015"],
"env": {
"development": {
"plugins": [
["transform-react-display-name"],
["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}]
]
}
}
} |
Same as above. Any news here? |
Looks like it's, I have it too. |
I'm running into the same issue. Since I'm prototyping something and I don't care about speed I ended up running |
Also, I've added a couple of is this a KP or are we just using the API the wrong way? :) |
@thejameskyle Is this something you can offer advice on? |
Yes, It seems that plugins all run in parallel with babel 6 (https://phabricator.babeljs.io/T6730). |
Hey all, I found a solution. There's a obscure package here: https://www.npmjs.com/package/react-transform-display-name that provides the same functionality as a transform in Under the
My full config:
|
Moving to #67 |
In the following code
Babel (via https://github.com/babel/babel/tree/development/packages/babel-plugin-react-display-name) adds the displayName property based on the variable name.
However, this react-transform plugin doesn't seem to find these display names. Perhaps this is something to do with the ordering of the plugins?
I notice you have a test-case which confirms this behaviour - https://github.com/gaearon/babel-plugin-react-transform/blob/master/test/fixtures/classic/expected.js#L146 - was this intentional or just something that isn't yet supported?
The text was updated successfully, but these errors were encountered: