I’ve noticed time and again that people don’t really understand the reason/history behind frameworks like React, Angular, Vue etc. It’s a different paradigm altogether (compared to Vanilla JavaScript or jQuery).
To really appreciate these tools, you’ll have to build complex user interactions and try keeping data and UI in sync using Vanilla JavaScript. You’ll quickly realise that apart from mutating data (shopping cart amount, product quantity), you’re forced to write boilerplate to change the HTML (store references to IDs and change .innerText). You are also forced to iterate and find documents within deep nested structures. Things are already complex and now we add API calls with error handling, loading spinners, notifications and modals to the mix.
Let’s build a shopping cart. First using Vanilla JavaScript and then the same cart using React 😊 My objective is to help you appreciate these tools, the pain points they solve, how they help with re-usability and learning to think in their paradigms.
Here’s the video of me coding and explaining the difference between both the approaches. Feel free to post any questions or comments.