salmannotkhan / typing-test

Typing test website build with React
https://salmannotkhan.github.io/typing-test/
MIT License
189 stars 55 forks source link

Convert to hook #2

Closed faustinozanetto closed 2 years ago

faustinozanetto commented 3 years ago

Is your feature request related to a problem? Please describe. My feature request is not related to a problem.

Describe the solution you'd like I really like your project! I was wondering if there would be a possibility of converting the project to use hooks and reducer instead of class componentes.

Describe alternatives you've considered I´ve already tryed to convert it but had no luck.

salmannotkhan commented 3 years ago

How do you think it can improve the performance or functionality of typing-test?

nooobcoder commented 3 years ago

@faustinozanetto totally agree buddy with you, using hooks with Functional components is a future-proof thing. Functional components shall live much longer than class components. Don't know if there are performance improvements, I think func components provide a better syntax and reduces the jargon of this keyword.

I totally agree with using hooks in modern React apps, although func components are stateless but hooks provide the feature to be stateful.

Really appreciate your suggestion buddy, don't know if @salmannotkhan will decide to port to hooks 🪝 or not

salmannotkhan commented 3 years ago

In our observation, the performance differences are negligible, though optimization strategies are a bit different.

In either case we don’t recommend rewriting your existing components unless you have other reasons and don’t mind being an early adopter.

Quoted from Dan Abramov(from React team) blog Reference

faustinozanetto commented 3 years ago

More than optimization, I think it would improve code legitibilty and it would be much cleanear and easier to understand.

salmannotkhan commented 3 years ago

Yes, it could be but currently I don't have time for converting components. I'll keep this issue open in case if someone wants to do it 👍

nooobcoder commented 3 years ago

Yes, it could be but currently I don't have time for converting components. I'll keep this issue open in case if someone wants to do it

I may try doing it, but hey the old pull requests are still open and you are not confined to either merging or closing them. Please let me know it's status so that I can start over converting to functional components if you are interested.

salmannotkhan commented 3 years ago

Yes, I know I've busy schedule right now due to studies. I'll definitely merge it after confirming

salmannotkhan commented 3 years ago

We can save docker implementation for later when I get time and you can start working functional components

salmannotkhan commented 2 years ago

I started learning functional programming. I think now is the time to work on this issue. I'll start the conversion from today only.

salmannotkhan commented 2 years ago

Now, typing-test is fully converted to functional-based components. It was possible by using redux for better state management.