3 ms·
Depends on your use case. For a simple website with maybe a form or two, React is overkill. When you're dealing with hundreds of pages with dynamically rendered
by supernintendo 10y ago
Depends on your use case. For a simple website with maybe a form or two, React is overkill. When you're dealing with hundreds of pages with dynamically rendered elements, it helps to keep things consistent and DRY. React helps achieve this through the use of components. For example, let's say I want to allow any button on my page to send a tracking event to Google Analytics on click if a certain attribute on the element is set. With React, I can add this feature for every button by modifying the `Button` component I built. This ends up being a lot easier than having to manually bind the tracking callback event to every `<button>` element that is rendered at some point (and also guarantees that event delegation takes place within the component rather than some other module in your application).
The component pattern is certainly not unique to React but it is a good design pattern that the framework encourages through JSX, component lifetime cycles, etc. While I can't speak for everyone, React has certainly made my life and the life of developers I work with easier since integrating it.