addons-frontend
addons-frontend copied to clipboard
Convert AddonInfo to a functional component with hooks
Fixes #11855
@diox @willdurand @eviljeff Here is a PR that demonstrates what's needed to convert a fairly simply class-based component to a functional component that uses hooks. It works, and I do think the code is nicer than the previous version. It's not a tremendous amount of work to do this, especially as I have now figured out what to do for the errorHandler
and mapStateToProps
.
One issue, however, is that the main impetus for doing this is to be able to upgrade to react-router v6
, but, as far as I can tell, react-router v6
has some incompatibilities with how we are doing SSR. These might be fairly easy to overcome, but it's going to take some more investigation and experimentation. I think at this point it makes sense to hold off converting any components to using hooks, until we can be sure that we can actually upgrade to react-router v6
and keep SSR working.
I'm going to close this for now as it will never be merged as is.