by vertex-four · 4y ago · 0 comments
For an uncommon use example of what could be possible:
(defmethod react.component:mount :after ((self counter)) ...) ; instead of componentDidMount
(defmethod react.component:update :around ((self counter)) ...) ; instead of shouldComponentUpdate
(defmethod react.component:unmount :before ((self counter)) ...) ; instead of componentWillUnmount
; (the react.component namespace qualifier could be whatever else and not necessarily typed out)
However closely you integrate it with the language, having that machinery generally available seems better for naming and for providing new lifecycle functionality, without everyone having to reinvent the wheel and provide it in different incompatible ways. But it's clearly not a big issue.