React-js is a JavaScript framework that allows developers to encapsulate code to make it more reusable. These encapsulated code snippets are called components . They can maintain their logic and state without interfering with what’s going on in Model Object document (DOM) .
Abstracting parts of your website into these smaller, smaller components to transfer data allows your code to become reusable and DRY ( D on’t R repeat Y us). There are two main types of components you will encounter in React: functional and class components
At a very high level, components of . react are basically JavaScript functions that take props as a parameter and return an React elements that basically describe what should be on the screen:
Hello, {} props.name