React — JavaScript’s bigger, badder little brother. Being a framework of JS and using similar syntax with JSX, if you already know JavaScript, React is worth learning for its functionality alone. Similar to functions in JavaScript, components accept props (inputs) and tell your computer what should be loading on the screen.

A component is essentially a building block of React. You could describe a React project as a Lego Castle and components as individual Lego blocks that make it complete. These components make it easier to locate parts of your code that you would like to update, especially when dealing with large projects. After you are done working on the components individually, you will merge them all into a larger parent component.

There are two main types of components: functional and class.

Functional Components

Functional components are essentially just JavaScript functions. It is still a React component because it accepts a single prop argument and returns a React element.

function Start = () => {

return <h1>Welcome to the start of something new.</h1>;

}

Class Components

Class components are smarter than functional components in the sense that they are aware of the other class components in your code and can work with them. Data in one class component can be shared with another class component, which can share more data to another class component and so on.

class Beginning extends React.Component

{

render() {

return<h1>Howdy!</h1>

}

}

Software Engineering Student @ Flatiron Denver. Located in Austin, TX