-
Notifications
You must be signed in to change notification settings - Fork 87
Only wrap descendants with render method, closes #84 #86
Conversation
@gaearon should i write a new test for each of the cases the current tests used to cover? |
Please do. |
something like this is not supposed to be wrapped, is it? import React, { Component } from 'react'
class Foo extends Component {
render() {}
} |
This looks like a React component to me, why not? |
because it requires changing this line https://github.com/gaearon/babel-plugin-react-transform/blob/master/src/index.js#L174 |
Good catch. I would say let’s add |
yeah i agree. does that go into this PR or another one (it's not really related to this)? |
It’s fine to do this here. |
Alright, it's all done i think.
|
Seems like technically this wouldn’t even be a breaking change because we used to allow any class with |
well it breaks some stuff that shouldn't work anyways, so that part is fine to me it looks like the only breaking change would be stuff like this: import React from 'react'
const Comp = React.Component
class Foo extends Comp {
render() {}
} this would have worked previously because it had a render method and now won't, but would anyone actually do something like this? |
Even if they used this pattern, we’re not technically “breaking” it because the code would still work. Transforms are meant for development only anyway. |
yeah that's true |
Only wrap descendants with render method, closes #84
Out in 2.0.1, thank you a lot! |
Happy to help! |
I'll look into it |
closes #84 (see the issue for a discussion of the changes)
todo