Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations: Refactor functional components #33

Open
Ostrzyciel opened this issue Feb 12, 2020 · 0 comments
Open

Annotations: Refactor functional components #33

Ostrzyciel opened this issue Feb 12, 2020 · 0 comments
Labels
annotations Things about the annotations application. enhancement New feature or request javascript Pull requests that update Javascript code

Comments

@Ostrzyciel
Copy link
Contributor

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.

@Ostrzyciel Ostrzyciel added enhancement New feature or request javascript Pull requests that update Javascript code annotations Things about the annotations application. labels Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotations Things about the annotations application. enhancement New feature or request javascript Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

1 participant