DEV Community

JC Latam
JC Latam

Posted on

What is a component in react?

Components are the building blocks of any React app and a typical React app will have many of these. Simply put, a component is a JavaScript class or function that optionally accepts inputs i.e. properties(props) and returns a React element that describes how a section of the User Interface should appear.

You can create your first component like this code:
const Greeting = () =>

Hello World today!

;

Source:https://medium.com/the-andela-way/understanding-react-components37f841c1f3bb#:~:text=Components%20are%20the%20building%20blocks,(User%20Interface)%20should%20appear.

Top comments (0)