Anpu Ann John
Anpu Ann John's Blog

Anpu Ann John's Blog

React Functional Components #2

Anpu Ann John's photo
Anpu Ann John
·Dec 15, 2020·

1 min read

Functional Components in React:

we use functional components in order to make the elements reusable. The elements to be rendered are written inside a function and pass the function as the argument inside the ReactDOM.render() method.

Screenshot (4).png

It is better to practice to create a file MyInfo.js inside the Components folder and move the function to the file.

Screenshot (7).png

Then import the MyInfo.js file to Index.js

Screenshot (5).png

Share this