SEARCH BY

All

  • All
  • Java8
  • Spring

Functional component in React Java Script ( ReactJS )

Post a Comment

What is component in React JS?

Component is a block of the code which allows us to split the UI into independent, reusable pieces and each component is isolated.

A react component is a javascript function which takes input ( called as props ) and returns React elements which describes what should appear on UI screen/page.

React element represents DOM tags

What is functional component in reactJS

Functional component is a javascript function which returns JSX (HTML). Functional component can accepts properties as a paramenter , which will be called as props , which are optional. Functional components can be imported and can be used as a normal HTML tag. Props to the functional component can be passed as attributes as like normal HTML tag attributes.

Creating function component

Here we will see how to create functional component in React JS

We can create javascript function in a javascript file

jaya
I love software designing, coding, writing and teaching...

Share this article

Related Posts

Post a Comment

Place your code in <em> </em> tags to send in comments | Do not add hyper links in commnet

Close

Subscribe our newsletter for the latest articles directly into your email inbox