Comments (5)
This will probably be solved by #26 when it's implemented.
Can you please say whether it works with React Hot Loader?
from babel-plugin-react-transform.
@gaearon It didn't work for me. I hope your big rewrite for babel 6 compatibility will fix this issue too.
Thanks
Bernd
from babel-plugin-react-transform.
As a quick hack, I changed getDisplayName
to:
function getDisplayName(node) {
if (node.arguments[0].properties) {
const property = find(node.arguments[0].properties, node => node.key.name === 'displayName');
return property && property.value.value;
} else {
return node.arguments[0].name;
}
}
And I updated my babel plugin config with the following:
[
"react-transform",
{
"transforms": [
{
"transform": "react-transform-hmr",
"imports": [
"react"
],
"locals": [
"module"
]
}
],
"factoryMethods": ["React.createClass", "Relay.createContainer"]
}
]
This makes it so hotloading will work when using Relay. It won't reload your fragments and re-fetch data... But it enables you to at least iterate on components, so I'd view it as an improvement.
from babel-plugin-react-transform.
I’m curious whether the approach from reduxjs/redux#1455 might help here. Namely, just nuke your components and mount new versions of them without React Transform altogether.
from babel-plugin-react-transform.
Thanks again for raising this.
I’m closing because you have several options:
- try the workaround I described in #45 (comment)
- wait for some solution to #26 which looks like one possible cause of this issue
- take the time to dive in, figure out why it doesn’t work, and maybe contribute that support 😉
I don’t plan to personally work on this in near term but I don’t see why it couldn’t be made to work given some effort.
This makes it so hotloading will work when using Relay. It won't reload your fragments and re-fetch data... But it enables you to at least iterate on components, so I'd view it as an improvement.
I’m rather confused. Babel plugin should find the inner component and force its re-rendering on changes regardless of whether it is wrapped in a Relay container or anything else. Is this not the case? Would you like to investigate why?
from babel-plugin-react-transform.
Related Issues (20)
- Local path as an argument to "transform" does not resolve the path.
- Modify the contents of the function will not be updated.
- Doesn't work with React.PureComponent HOT 1
- Template is not a function
- Deprecated with no alternative? HOT 1
- no release info or changelog for 3.0.0
- `addImport()` is deprecated in Babel 7 HOT 2
- Use without .babelrc HOT 4
- jspm with plugin-babel and react preset: "cannot read property 'transform' of undefined" HOT 1
- React transforms being run on Backbone views HOT 6
- Question: Is it a bad practice to use react-transform for production code? HOT 1
- Transform(s) to strip propTypes and displayName HOT 4
- Ember objects detected as react components HOT 5
- Appears to wrap other functions than createClass() HOT 10
- error when passing properties to createClass() HOT 4
- Future of React Transform HOT 2
- Can we have superClass Regexp matching option , for inheritance ? HOT 2
- undefined value static properties outside class HOT 3
- displayName equals 'Constructor' HOT 8
- static properties are undefined HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-react-transform.