Annotations: Refactor functional components #33
Labels
annotations
Things about the annotations application.
enhancement
New feature or request
javascript
Pull requests that update Javascript code
In React there are two types of components: functional and class. They differ in syntax, how their state is handled and in many other aspects. The problem that we encountered during the development was that the functional components are harder to test. Generally, with the class components one is able to unit test each method, just by accessing it through the constructed object. It is not possible to do that with functional components, the only way to access their methods is to perform the action that fires the required event, such clicking a button. Very often it is not as easy as just clicking the button and then the creation of unit tests becomes very cumbersome.
That is why we propose refactoring all functional components into class components.
The text was updated successfully, but these errors were encountered: