My Road to React: Getting Started (Components and binding)

A long and windy road
It's gonna be long and windy!

So it looks like I will be learning React this summer! This is a change from what I thought that I would be doing, but I am excited.

A little bit about what's going on:

  • I am starting as a contractor at Episode Six on Monday.
  • The plan was to build in Java, but it looks like I will be doing mostly React?
  • The goal is that this turns into a full offer and that I get hired on.

I decided to start learning React in depth because I don't want to be babysat or feel like a drag on the team just coming in the door. So I searched around for materials by which to learn React. "The Road to React" seems the best that I have come across so far (it just fits my style). 

The book starts with a challenge to share what you have learned and I think that is a wonderful idea. So here we go:

Today I learned that Components, instances, and elements are different things in React. This at first was confusing, but I think that I have it now. Components are the pieces that make up your React App. They are created and you can refer to or use instances of those Components. That's not so bad. Kind of like creating Objects in general. So then elements are how you communicate to React what you actually want to render. They are basically like HTML elements that create real markup on the page. 

Second, I learned that you can bind a method to a class that make it a class method. You do that by this bit of code:

this.example = this.example.bind(this);

The "this" keyword is certainly more confusing on approach in JS than it was in Java (for me). It seems so multiple and ineffable at first. Here's what is happening in that code up there if I understand it correctly:

this.example is a method that is being "bound" or attached to the React component. It is now a class method.

It is going to take me a while to get this down. I am however, not alone. Neither are you. We got this!

Hands in a huddle
We are all together.