Why use React instead of JavaScript HTML and CSS

     Why use React instead of JavaScript HTML and CSS


        Even if you use React, you're still using JS, HTML, and CSS. What you're getting with React is a library that lets you create custom components.

Unfortunately a lot of the replies you're going to get are from people that assume you cannot have components without the use of React, Angular, or Vue and that's simply not true anymore. Most of the browsers now support custom elements (for example, "<my-fancy-search>" or "<pie-graph>") and the few that do not can load up a poly fill and get the same ability.

        What you probably want to do is build components to break up your page into chunks of code which are both easier to debug and potentially easier to reuse across pages. You can use any of the popular libraries I mentioned above to help you do that or you can start using Web Components to do the same thing (for example, the current version of YouTube uses Web Components and the Polymer library to make it easier to write the components).

        That component style page design is not unique to any of the libraries but it does make it much easier to conceptualize building a page. It allows you to say, what if I could build a page using elements which make sense for my page ("<home-page>", "<about-page>", "<user-page>") and sub-components on each of those pages to break them up rather than always having to start at the same fine grained level of abstraction that is "<div>", "<span>", "<input>", etc.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...