DEV Community

FTWCougar
FTWCougar

Posted on

React Components

Today we'll be talking about components built from react.
React is a library built for javascript and is very useful when it comes to building out web applications.

A component built from react looks like this

const ReactComponent = () => {
return(
<div>
<p>Hello World</p>
</div>
)
}
Enter fullscreen mode Exit fullscreen mode

It looks really simple and it is. This is useful because previously in javaScript you would have to write it all out individually telling it what the text content is and where to append it to. This way is faster and much easier to read than basic javaScript. Each component doesn't have to be that simple you can pass down props from the parent and use that to show data to the screen or for forms you can use callback functions to go up to the parent. You can also have what is called useState which can keep track of data from the user and update the web page based on that data.
React is very useful to everyone once you get to know it. React components

Top comments (0)