addons-frontend icon indicating copy to clipboard operation
addons-frontend copied to clipboard

Convert AddonInfo to a functional component with hooks

Open bobsilverberg opened this issue 2 years ago • 1 comments

Fixes #11855

bobsilverberg avatar Sep 29 '22 19:09 bobsilverberg

@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.

bobsilverberg avatar Oct 03 '22 15:10 bobsilverberg

I'm going to close this for now as it will never be merged as is.

bobsilverberg avatar Oct 27 '22 12:10 bobsilverberg