Components in web development are building blocks of the app. The entire application is built with many tiny such components. For example - a page can have components like navbar, content block, card, image carousel, a form, and a footer. In the bigger picture, it can be notification toasts, statistics, activity logs, settings, etc.
By dividing the application into many tiny and self-sufficient components it becomes easy to reuse or modify them independently. All together they render the fully functional application.
To name a few - React, Angular or Vuejs encourage developers to follow such development pattern and it is eaxctly how it should be at first place.
We are going to create a React button component that when clicked, the page smoothly scrolls back to the top. Here is the simple concept to achieve t...