What’s up guys- I’m very excited to embark in this blogging adventure. The truth is that I love learning and development, so I decided to create a blog as a guide to go back to whenever I forget how something works. I would also like to share what I’m learning in order to give back to the community and strengthen my teaching skills. I believe you don’t learn something fully until you teach it to someone else.
I would like to start with the very basics of React. You can find all of this information and more in the documentation (Which is very clear and easy to understand, by the way).
What is React?
Why learn React?
React also has a great Community. It’s easy to ask and get answers online. Facebook, Netflix and Uber are all injecting huge amounts of money into the library to improve its ecosystem.
The Idea of Components
Components are pieces of a user interface. Put a couple of components together and you have a website. It also makes bigger apps very manageable. You can divide the whole app into little reusable pieces that make it very easy to manage scalable applications (Easy to test).
Like it says in the React Docs, Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. React.Component is provided by React. This means that we can focus on passing and managing data individually for each one of the pieces that build the entire application. You can separate functionality which makes it way easier to test and leaves little room for bugs.
The Component Lifecycle
Components have different “Lifecycle methods” which allow you run certain code at different times. The methods can either be called with will or did. When will is prefixed, the method is used right before something happens. When did is prefixed, the method is called right after something happens. As we move forward I will provide more actual examples of how do these exactly work.
This is just a little introduction to what the React library is about and why I decided to move along mastering it.
Happy coding and have a great day.
– Cristian Rodriguez