React Functional Components #2

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