This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Lifecycle methods: drop the 'component'. just 'willMount'. it's cleaner #40
Closed
Description
Pardon the stupid joke.
I was curious what was the rationale (if there is one) behind having 'component' in the lifecycle methods. To me it seems unnecessary as they are clearly in the context of a component. What would make sense to me though is grouping the lifecycle methods like this:
class Example extends React.Component {
lifecycle: {
willMount() {...},
didMount() {...},
willReceiveProps() {...},
//especially weird that shouldComponentUpdate is the only method that has 'component' in the middle
shouldUpdate() {...},
willUpdate() {...},
didUpdate() {...},
willUnmount() {...},
}
}
Metadata
Metadata
Assignees
Labels
No labels