-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let me use inheritance with componentDidMoubt #2012
Comments
Duplicate component*-methods are all called, they are not replaced. Anyway, you are free to implement whatever form of class composition you want to create the object for |
Why would they deprecate it? Its used across everything. Do they know what they are replacing it with? as for duplicate methods, yes they are called but it errors out stating that you have defined this else where. (I assumed it could be fixed with class composition) |
@AdamKyle https://github.com/reactjs/react-future/blob/master/01%20-%20Core/05%20-%20Elements.js Most of the information is kind of spread out, and in some ways it's simply being renamed I guess. But the idea is that you will supply the class and you can ask React to create an "element factory" from it ( |
It's not clear to me what you really want. The code you have in your example calls both methods.
I haven't seen this be the case. Only 1 lifecycle method restricts itself to be defined once ( There's more discussion about the future of mixins in #1380. There doesn't appear to be anything currently actionable here so I'm going to close out. |
Consider the following:
The above will not work because as you can see I have declared the existence of
componentDidMount()
twice. This would be fair if we didn't have libraries such as underscore or similar libraries that make the use of_.extend
which then lets us do:So my question is, as some one who likes to abstract common logic out and use inheritance (I mix backbone with react) - Why can I not use inheritance to say "did my component mount, yes do this - oh and call the parent
The text was updated successfully, but these errors were encountered: