Understanding object and learning react.js

Just how essential is learning how objects (prototype inheritance, and constructors) important to learning react.js. I am teaching myself as much vanilla JS as possible before tacking learning that beast?

I am a novice JS learner tacking the concept and creation of making my own objects for web apps and I sense its the core of JS. If you have used react.js for anything recently please respond to this inquiry. All comments are welcome.

Additionally, does anyone know any online quizzes I can use to text my react.js know how? Or perhaps simple projects to start on my own?

(I know I can google the last two questions but there is something about having recommended resources from a dev community that are more valid than just what google says I should use!)

I think you could write good react code even if you didn’t know how classes and inheritance work under the hood.

class MyComponent extends React.Component {
    // ...
}

You don’t really need to know how JavaScript’s classes and inheritance work to be able to write simple code like this. It’s still nice to learn eventually, but it’s not a blocker to getting started with react.

1 Like

You should probably learn these things as much as you can anyway. You obviously know what some of the concepts are, so you just need to put them into practice to let them sink in. You can do that while building stuff with React. I agree with @Jeff_Mott

But it depends on what your goal is.

Is your goal to learn JS? Frameworks come and go, learning JS is a very useful skill. Then you should learn as much as you can and build as much as you can before jumping into React. As long as you’re staying productive and interested.

Is your goal to build stuff that works for a business need or a (semi) serious project idea? Then pick up a framework and learn by doing.

Is your goal to just learn enough to be able to do the above? Then maybe a stronger mix. Use a framework, but focus heavily on core concepts.

Just do stuff. Just keep in mind that you’re trying to learn and develop core skills that can be taken to other frameworks or outside of JS entirely. Try to do things right, but don’t worry yourself to the point where you’re not productive because of it. It’s ok if things are a little wrong as long as you’re learning and it doesn’t cause serious issues.

1 Like

You don’t really need to know how JavaScript’s classes and inheritance work

You mentioned classes. I was talking about constructors and prototypes. Are those classes? I heard of classes in quick study I did in ES6?

It sound likes the third suggestion you said is what’s best and its extremely encouraging to know I’m on the right path. I need to learn React.js for my job, but I want to be a full stack web developer. Preferably in JS because we use node.js alot as well along with WebPack and graph QL. JS is my first official programming language. In the long term, I want to learn C# so I can build video games in Unity as well.

thanks for the advice and not scolding me like stackoverflow forums would :slight_smile:

1 Like

class MyComponent extends React.Component {
// …
}

I think you could write good react code even if you didn’t know how classes and inheritance work under the hood.

I understand your response as something that implies that objects really aren’t the basis of React.js.

Aren’t the main parts of React.js (render, createclass, scale etc) objects?

Classes are a nicer, sugary syntax for defining a constructor and assigning methods to its prototype. In the React docs, you’ll often see them using class to define components.

You might like this walkthrough. It should give you good practice of connecting React to an API.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.