This past weeks I’ve been dipping my toes, and then diving head first into the deep end with ReactJS and Redux, and as a programmer coming from a PHP background, there is certainly a learning curve. The challenge for me is to create a completely new page with a lot of interaction, all the while learning ReactJS from scratch.
It feels a bit like this...
It is a tough thing to get through. Within a few days from the start I had a simple form functioning, which passed the data back to the API for saving, but afterwards things started to slow down. I attribute that slowdown to the learning curve of ReactJS, not as much the language itself, but more the core concepts of the framework. Since then I’ve started with a ReactJS tutorial, and that really has helped me in understanding how vanilla ReactJS works, as well as adding Redux in the mix.
This article by John Kagga has also helped me a lot understanding the concepts within ReactJS:
Generally, it is preferred to use functional components whenever possible because of their predictability and conciseness. Since, they are purely presentational, their output is always the same given the same props. … It’s important to note that props are read-only and that a component must never modify the props passed to it. As such, when a component is passed props as input, it should always return the same result for the same input. … Functional components can be referenced within class components and vice versa. However, it is not often that you will reference a class component within a functional component; class components typically serve as container components.
Dan Abramov also wrote a clear article about the distinction of the two concepts.
Thankfully within Ageras there are also a few colleagues that can help me, and looking at their code provides also some footholds. Although I do understand the code they write, and identifying whether the concepts will provide a good way forward or can be a hindrance, it is a very different game writing such code myself. At moments I have really asked myself whether it should be such a struggle, and continuously I’ve found myself saying that “yes, it is”. Programming isn’t easy, and even for experienced programmers a new language or framework requires time to learn.
P.S. If you’ve enjoyed this article or found it helpful, please share it, or check out my other articles. I’m on Instagram and Twitter too if you’d like to follow along on my adventures and other writings, or comment on the article.