When we began developing the workbench, class components were the standard and functional components were new. React has moved away from class components, and functional components are the standard. I haven't seen any indication that class components will be deprecated any time soon, but there are some reasons it would make sense to convert our code to use functional components:
Documentation about class components has been moved to a legacy site and is no longer updated
It's increasingly hard to find tutorials and code examples using class components
i18next is easier to use with functional components; exported class components require a workaround
We often use the pattern of passing component functions as props to other components. eslintwarns against this, and the recommended solution uses the functional component style.
We have written our newer components using the functional style, and found it to work well and require less boilerplate code
When working on code that uses both styles of components, I find it confusing having to switch back and forth
When we began developing the workbench, class components were the standard and functional components were new. React has moved away from class components, and functional components are the standard. I haven't seen any indication that class components will be deprecated any time soon, but there are some reasons it would make sense to convert our code to use functional components:
i18next
is easier to use with functional components; exported class components require a workaroundeslint
warns against this, and the recommended solution uses the functional component style.