SMELLING THE REACT: MY JOURNEY INTO THE WORLD OF REACT.JS
Shashika Jayathilaka
ETE @elogicLanka | Fullstack Developer | PHP | Laravel | ReactJS
React.js is known for making web development simpler and more efficient, but there’s more to it than just building user interfaces. In my recent journey, I’ve explored how React simplifies UI creation by breaking it down into components while introducing tools and best practices to streamline development.
Why You Should Learn React
React isn't just a library—it’s a gateway to building modern, fast, and scalable web applications. Unlike frameworks that try to provide everything, React focuses on user interface development. You don’t need to know everything to get started with React, which makes it an ideal choice for developers of all levels.
Key Features of React:
Component-Based Architecture: React allows you to break down your UI into small, reusable components, making development easier and more modular.
Fast Refresh: This feature enables real-time updates when modifying components, without losing the application’s state.
Third-Party Solutions: With its active community, many of the challenges developers face have already been solved through third-party packages and open-source projects.
React's Versatility
React is not limited to websites. You can use it to build various types of applications, such as:
Setting Up the Environment
Setting up React might seem complex at first, but the process can be straightforward with the right tools:
领英推荐
Creating a Basic React Application
Here’s the step-by-step breakdown of creating a React app manually, which helped me grasp its core concepts:
Key Concepts I Learned So Far:
Efficiency Through Automation
Manually running Babel to compile the JSX each time I made a change was repetitive. I switched to using --watch mode with Babel, allowing real-time updates whenever I edited the code:
npx babel src/app.js --out-file=public/js/app.js --presets=@babel/env,@babel/react --watch
This ensured that my React app would refresh automatically with every code change, making development smoother.
Rendering Dynamic Data and Arrays
I also learned how to handle dynamic data in React, such as rendering lists of student details. The key prop is crucial here, as it helps React track which items have changed, improving the efficiency of rendering lists:
students.map((student) => <div key={student.id}>{student.name}</div>);
React fragments were another interesting concept. Although fragments help prevent unnecessary DOM elements, in cases where unique keys are needed, using a <div> instead of a fragment can be more practical.
Moving Forward
My initial experience with React has been rewarding, and I am excited to continue exploring advanced topics like state management, hooks, and API integration. The beauty of React lies in its simplicity and efficiency. As I progress, I aim to build more complex applications and contribute to open-source projects in the React ecosystem.
Web Consultant | React Instructor (200+ Developers Taught) | MERN-Stack Developer | React, Node.js
6 个月way to go ??
KINGSTON ENGINEERING COLLEGE
6 个月Interesting
Electronics and Telecommunication Engineering Graduate | CCNA | Software Engineer | FullStack Developer | QA Enthusiast | PHP | Laravel | JavaScript | JQuery | HTML | CSS | SQL | Java
6 个月Very informative !