Learning ReactJS: My Thoughts and Experience

2022-02-19

My Thoughts and Experience

As I've been diving into the world of front-end development, as a front end web developer, I've found myself drawn to ReactJS. It's one of the most popular JavaScript libraries out there, and for good reason with competitors like AngularJS and VueJS. In this article, I'll share my thoughts on learning React, the pros and cons I've encountered, and a project I built along the way.

Why Learn ReactJS?

ReactJS has been a game changer for many developers, and I wanted to see what all the fuss was about. With its component-based architecture and virtual DOM, React promises to make building reusable UI components a breeze. I was excited to see if it lived up to the hype.

Appreciating ReactJS

I've developed a deep appreciation for ReactJS as a powerful tool for building complex, scalable, and maintainable applications. Its component-based architecture, virtual DOM, and robust ecosystem make it an ideal choice for large-scale projects that require a high degree of interactivity and dynamic updates.
React's strengths lie in its ability to:
  • Manage complex state changes: React's component lifecycle and state management features make it well-suited for applications with intricate logic and multiple, interconnected components.
  • Optimize performance: The virtual DOM and efficient rendering mechanisms ensure that React applications can handle large amounts of data and complex UI updates without sacrificing performance.
  • Foster a community-driven ecosystem: React's massive community and wealth of third-party libraries and tools make it an attractive choice for developers who value collaboration and rapid developmen

The Need for ReactJS

ReactJS is particularly useful when building:
  • Complex, data-driven applications: React's ability to manage state changes and optimize performance makes it an excellent choice for applications that involve complex data interactions, such as dashboards, analytics platforms, or social media feeds.
  • Highly interactive user interfaces: React's component-based architecture and efficient rendering mechanisms make it well-suited for building highly interactive UI components, such as real-time updates, live updates, or complex animations.

Overusing ReactJS

However, I've noticed that ReactJS is often used for simple projects or applications that don't require its full feature set. While React can certainly be used for small projects, it can also introduce unnecessary complexity and overhead.
When I was learning React, I struggled with simple tasks because:
  • Overhead and complexity: React's component lifecycle, state management, and JSX syntax can be overwhelming for small projects or simple applications.
  • Boilerplate code: React requires a certain amount of boilerplate code, which can be tedious for small projects or prototypes.
In such cases, simpler alternatives like vanilla JavaScript, HTML, and CSS might be more suitable. ReactJS is a powerful tool that shines in complex applications, but it's not always the best choice for every project. For simple screen such as a login screen or a very simple landing page. A lot of the ReactJS dynamic capabilities were underutilized for such pages, making simpler, lightweight solutions more appropriate. Addiotionally, the initial load time is increased when employing ReactJS as it inherently requires downloading, parsing and executing JavaScript bundless for the UI to render. This process can and will often delay the user, especially on low powered devices or slow networks.

Pros and Cons of React

Some of the pros of React include:
  • Component Reusability: One of the biggest advantages of React is the ability to break down your UI into reusable components. This makes it easy to maintain and update your codebase.
  • Virtual DOM: React's virtual DOM makes rendering and updating the UI a snap. It's incredibly efficient and fast.
  • Large Community: React has an enormous community of developers who contribute to its ecosystem. This means there are plenty of resources available to help you learn and troubleshoot.
Some of the cons include:
  • Steep Learning Curve: While I enjoyed learning React, I did find it challenging at times. The concept of state management and props can be tricky to grasp at first.
  • Over-Engineering: With React's emphasis on components, it's easy to over-engineer your application. This can lead to a complex codebase that's hard to maintain.

My Project: Note App

To put my newfound knowledge to the test, I built a simple note-taking app. The app allows users to add new notes by clicking a button, and each note is displayed on the screen. The user is able to edit a create node and even delete it off the screen, you can check out the code on GitHub. I used CodeSandbox to develop the project, which made it easy to iterate and test my code. This is a highly reccomended tool, especially for someone who is learning the ropes with ReactJS and is is actually something I may implement into my own work working as a front end web developer as you can immediatly see the changes you made in real time. If you're someone like me who always has to play around and tweak the CSS style sheet to get the look you want than CodeSandbox is for you. You can also view the project on CodeSandbox after that tangent and view my code and structure for the project on the left with an interactive screen on the right. This project was a personal project to build something meaningful. Wouldn't be too hard to connect it to a backend if I do decide to do that as what I consider the difficult bit, the front end, is done. 

Conclusion

Overall, I'm impressed with ReactJS capabilities and the community surrounding it. While it does have a learning curve, the benefits far outweigh the drawbacks. By understanding when to use React and when to opt for simpler solutions, developers can harness its power to build complex, scalable, and maintainable applications. I'm excited to continue building projects with React and exploring its many features.

More posts connected by shared tags or overlapping topics.

Web Scraping Series Part 2 Dynamic Pages and Browser Automation with Selenium

Related topics: and, web

Read post

Web Scraping Series (Part 1): The Basics of Web Scraping

Related topics: the, web

Read post

Predicting Titanic Survival: A Beginner's Machine Learning Walkthrough with Python

Related topics: learning, the

Read post