<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Frontend on Ghafoor's Personal Blog</title><link>http://ghafoorsblog.com/categories/frontend/</link><description>Recent content in Frontend on Ghafoor's Personal Blog</description><generator>Hugo</generator><language>en</language><managingEditor>noreply@example.com (AG Sayyed)</managingEditor><webMaster>noreply@example.com (AG Sayyed)</webMaster><copyright>Copyright © 2024-2026 AG Sayyed. All Rights Reserved.</copyright><lastBuildDate>Sat, 16 May 2026 17:42:12 +0100</lastBuildDate><atom:link href="http://ghafoorsblog.com/categories/frontend/index.xml" rel="self" type="application/rss+xml"/><item><title>External Service</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/003-external-service/</link><pubDate>Tue, 29 Jul 2025 15:47:06 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/003-external-service/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers how to connect React applications to external services using APIs. It explains data fetching with Fetch API and Axios, error handling, and best practices for integrating third-party platforms and services.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-external-services-and-apis"&gt;Introduction to External Services and APIs&lt;/h2&gt;
&lt;p&gt;External services are third-party platforms, applications, or systems that your React app connects to over a network. These services provide features, tools, or data via APIs (Application Programming Interfaces), enabling data exchange and integration.&lt;/p&gt;</description></item><item><title>Custom Hooks</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/002-custom-hooks/</link><pubDate>Tue, 29 Jul 2025 15:44:31 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/002-custom-hooks/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers the use of useEffect and custom hooks in React. It explains how to manage side effects, use dependency arrays, and create reusable logic for function components using custom hooks.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-side-effects-and-useeffect"&gt;Introduction to Side Effects and useEffect&lt;/h2&gt;
&lt;p&gt;In React, a side effect is any operation that affects the application outside the component&amp;rsquo;s render process, such as data fetching, event subscriptions, DOM manipulation, or timers. The &lt;code&gt;useEffect&lt;/code&gt; hook allows function components to perform side effects efficiently.&lt;/p&gt;</description></item><item><title>Hooks</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/001-hooks/</link><pubDate>Tue, 29 Jul 2025 15:36:55 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/03-module/001-hooks/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers the purpose, advantages, and best practices of using Hooks in React. It explains how Hooks enable function components to manage state, side effects, and reusable logic, and contrasts standard and custom hooks.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-hooks"&gt;Introduction to Hooks&lt;/h2&gt;
&lt;p&gt;Hooks were introduced in &lt;code&gt;React 16.8&lt;/code&gt; to provide function components with the same capabilities as class components, such as managing state and lifecycle events, without the complexity of classes.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="purpose-and-advantages-of-hooks"&gt;Purpose and Advantages of Hooks&lt;/h2&gt;
&lt;p&gt;Hooks allow function components to access and manage state, handle side effects, and share logic across components. They simplify code, improve readability, and enable more modular and reusable components. Hooks also boost performance and reduce code duplication.&lt;/p&gt;</description></item><item><title>Module Summary</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/009-module-summry/</link><pubDate>Tue, 29 Jul 2025 10:15:14 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/009-module-summry/</guid><description>&lt;p class="lead text-primary"&gt;
This document summarizes the essential concepts from Module 2, including arrays in components, the virtual DOM, and styling approaches in React. It provides a structured overview of how these features enable dynamic, efficient, and maintainable user interfaces.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="module-summary"&gt;Module Summary&lt;/h2&gt;
&lt;h3 id="function-components"&gt;Function Components&lt;/h3&gt;
&lt;p&gt;Function components are the primary building blocks in React, defined as JavaScript functions that return JSX. They are simple, reusable, and support hooks for state and side effects.&lt;/p&gt;</description></item><item><title>Styles</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/008-styles/</link><pubDate>Tue, 29 Jul 2025 09:27:38 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/008-styles/</guid><description>&lt;h2 id="styles-in-react"&gt;Styles in React&lt;/h2&gt;
&lt;p&gt;In React, styles can be applied to components in various ways, including inline styles, CSS stylesheets, CSS modules, and styled-components. Each method has its own use cases and advantages.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="inline-styles"&gt;Inline Styles&lt;/h3&gt;
&lt;p&gt;Inline styles are defined directly within the component using a JavaScript object. This method is useful for dynamic styles that depend on component state or props.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-jsx" data-lang="jsx"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 2&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 3&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;blue&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 4&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;lightgray&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 5&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;10px&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 6&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;borderRadius&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;5px&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 7&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 8&lt;/span&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt; 9&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;}&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;10&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;11&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Or
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;12&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;13&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;14&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;15&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;16&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;blue&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;17&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;lightgray&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;18&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;10px&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;19&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;borderRadius&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;5px&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;20&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;21&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;22&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}}&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;23&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;24&lt;/span&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;25&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Inline styles are defined as a JavaScript object.&lt;/li&gt;
&lt;li&gt;Property names are written in camelCase (e.g., &lt;code&gt;backgroundColor&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Values are specified as strings.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="css-modules"&gt;CSS Modules&lt;/h3&gt;
&lt;p&gt;CSS Modules allow you to write CSS that is scoped locally to the component, preventing style conflicts. They are implemented as a file with a &lt;code&gt;.module.css&lt;/code&gt; extension.&lt;/p&gt;</description></item><item><title>Vdom in React</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/007-vdom-in-react/</link><pubDate>Tue, 29 Jul 2025 09:22:38 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/007-vdom-in-react/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers the virtual DOM in React, including its structure, how it optimizes updates, the reconciliation process, and the key differences and advantages over the normal DOM.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-the-dom"&gt;Introduction to the DOM&lt;/h2&gt;
&lt;p&gt;The Document Object Model (DOM) is an interface for web pages that represents HTML as a tree-like structure. Each node in the tree corresponds to elements, attributes, or text in the document. The DOM enables programs to access and manipulate content, structure, and style dynamically.&lt;/p&gt;</description></item><item><title>Arrays in Component</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/006-arrays-in-component/</link><pubDate>Tue, 29 Jul 2025 08:40:18 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/006-arrays-in-component/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers how to declare, traverse, and manage arrays in React components, including state management, rendering lists, and using array methods like map, forEach, and splice for dynamic UIs.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="arrays-in-react-components"&gt;Arrays in React Components&lt;/h2&gt;
&lt;p&gt;Arrays are fundamental data structures in JavaScript, used to store multiple values in a single variable. In React, arrays are essential for managing lists of data and building dynamic user interfaces.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="declaring-and-managing-arrays"&gt;Declaring and Managing Arrays&lt;/h2&gt;
&lt;p&gt;Arrays can be declared using array literal notation:&lt;/p&gt;</description></item><item><title>Component Testing</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/005-component-testing/</link><pubDate>Tue, 29 Jul 2025 08:30:45 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/005-component-testing/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers the fundamentals of testing React components, including the advantages and disadvantages, testing approaches, Arrange-Act-Assert pattern, and popular tools like Jest and React Testing Library.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-component-testing"&gt;Introduction to Component Testing&lt;/h2&gt;
&lt;p&gt;Testing is the process of reviewing how code executes, either line-by-line or through suites that verify application behavior. It ensures that applications work as intended and helps prevent regressions.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="advantages-and-disadvantages-of-testing"&gt;Advantages and Disadvantages of Testing&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prevents unexpected regressions&lt;/li&gt;
&lt;li&gt;Allows developers to focus on current tasks&lt;/li&gt;
&lt;li&gt;Enables modular construction of complex applications&lt;/li&gt;
&lt;li&gt;Reduces the need for manual verification&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Disadvantages:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Function Comp Lifecycle</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/004-function-comp-lifecycle/</link><pubDate>Tue, 29 Jul 2025 08:16:33 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/004-function-comp-lifecycle/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers the four phases of the React function component lifecycle—mounting, updating, unmounting, and error handling—explaining how hooks like useState and useEffect enable similar control as class lifecycle methods.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="function-component-lifecycle-in-react"&gt;Function Component Lifecycle in React&lt;/h2&gt;
&lt;p&gt;React function components are the core building blocks for user interfaces. Understanding their lifecycle is essential for managing state, side effects, and cleanup throughout a component’s existence.&lt;/p&gt;
&lt;h3 id="lifecycle-phases-overview"&gt;Lifecycle Phases Overview&lt;/h3&gt;
&lt;p&gt;React function components experience four main phases:&lt;/p&gt;</description></item><item><title>State Management</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/003-state-management/</link><pubDate>Tue, 29 Jul 2025 08:11:02 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/003-state-management/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers state management in React function components, including the useState hook, syntax, and practical examples for managing and updating dynamic data in the UI.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="state-management-in-react-function-components"&gt;State Management in React Function Components&lt;/h2&gt;
&lt;p&gt;State management allows React components to handle data that changes over time. The state of a component determines its behavior and how it renders at any given moment.&lt;/p&gt;
&lt;h3 id="what-is-state"&gt;What is State&lt;/h3&gt;
&lt;p&gt;State refers to the condition or data of a component at a specific time. It holds information that influences the component&amp;rsquo;s behavior and rendering.&lt;/p&gt;</description></item><item><title>Component Composition</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/002-component-composition/</link><pubDate>Tue, 29 Jul 2025 07:54:24 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/002-component-composition/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores how React component composition enables building complex UIs from smaller, reusable function components. It covers abstraction, reusability, hierarchy, props, children, and higher-order components, with practical examples for clarity.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="component-composition-in-react"&gt;Component Composition in React&lt;/h2&gt;
&lt;p&gt;Component composition is the process of combining multiple smaller components to create more complex functionality and larger UI structures. This approach allows developers to build applications using small, focused building blocks.&lt;/p&gt;
&lt;h3 id="principles-of-function-component-composition"&gt;Principles of Function Component Composition&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Abstraction:&lt;/strong&gt; Create reusable components that encapsulate specific UI features, breaking down large interfaces into manageable pieces.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reusability:&lt;/strong&gt; Avoid code duplication by reusing components across different parts of the application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hierarchy:&lt;/strong&gt; Arrange components in parent-child relationships, supporting modular and organized design.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Props and Children:&lt;/strong&gt; Pass data and even entire components as props or children, enabling flexible composition.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Higher-Order Components (HOCs):&lt;/strong&gt; Write functions that accept components as input or return enhanced components, adding features like state management or logic without modifying the original implementation.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="example-composing-a-blog-post-ui"&gt;Example: Composing a Blog Post UI&lt;/h2&gt;
&lt;p&gt;Below is a practical example demonstrating these principles. Each component encapsulates a specific feature of a blog post, such as title, author, type, and description.&lt;/p&gt;</description></item><item><title>Function Component</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/001-function-component/</link><pubDate>Tue, 29 Jul 2025 07:41:04 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/02-module/001-function-component/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores how React function components use props to pass data, set default values, and handle events. It covers the principles of reusability, unidirectional data flow, customization, and composition, as well as practical event handling and conditional rendering techniques.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="working-with-function-components--props-and-event-handling"&gt;Working with Function Components – Props and Event Handling&lt;/h2&gt;
&lt;p&gt;Function components in React use properties, known as props, to pass data from parent to child components. Props are similar to objects and store the attributes of a component. They are immutable, meaning their values cannot be changed by the child component.&lt;/p&gt;</description></item><item><title>Module Summary</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/011-module-summary/</link><pubDate>Sat, 26 Jul 2025 19:29:19 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/011-module-summary/</guid><description>&lt;p class="lead text-primary"&gt;
This document summarizes the essential concepts of React components, including their types, state and props management, event handling, and the component lifecycle. It provides a structured overview of how these features enable modular and interactive user interfaces in React applications.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="module-summary"&gt;Module Summary&lt;/h2&gt;
&lt;h3 id="react-component-types"&gt;React Component Types&lt;/h3&gt;
&lt;p&gt;React components allow the user interface to be divided into reusable, independent parts. The main types are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Functional components&lt;/strong&gt;: Simple functions that return JSX.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Class components&lt;/strong&gt;: JavaScript classes extending &lt;code&gt;React.Component&lt;/code&gt;, supporting state and lifecycle methods.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Higher-order components&lt;/strong&gt;: Functions that take a component and return a new component.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="state-and-props"&gt;State and Props&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;State&lt;/strong&gt;: A plain JavaScript object representing a component&amp;rsquo;s dynamic data. Changes in state trigger re-rendering.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Props&lt;/strong&gt;: Properties passed from parent to child components, enabling data flow and configuration.&lt;/li&gt;
&lt;li&gt;Components manage their own state but receive data from outside via props.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="event-handling"&gt;Event Handling&lt;/h3&gt;
&lt;p&gt;Event handling in React manages user interactions such as clicks, mouse events, and form submissions. Event handlers are passed as props or defined within components to update state or trigger actions.&lt;/p&gt;</description></item><item><title>Passing Data Between Components</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/010-data-bw-component/</link><pubDate>Sat, 26 Jul 2025 19:20:24 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/010-data-bw-component/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores how React components manage and exchange data and state, detailing the component lifecycle phases, parent-child and child-parent communication patterns, and practical examples for robust state management in modern React applications.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="react-component-lifecycle-and-data-flow"&gt;React Component Lifecycle and Data Flow&lt;/h2&gt;
&lt;p&gt;React components have three main lifecycle phases: mounting, updating, and unmounting. Each phase involves specific methods that control how components are created, updated, and removed from the DOM.&lt;/p&gt;
&lt;h3 id="lifecycle-phases"&gt;Lifecycle Phases&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Phase&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Mounting&lt;/td&gt;
 &lt;td&gt;Component is created and inserted into the DOM&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Updating&lt;/td&gt;
 &lt;td&gt;Component re-renders due to state or prop changes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Unmounting&lt;/td&gt;
 &lt;td&gt;Component is removed from the DOM&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="mounting-methods"&gt;Mounting Methods&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;constructor&lt;/strong&gt;: Initializes the component and state, may call &lt;code&gt;super(props)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;getDerivedStateFromProps&lt;/strong&gt;: Syncs state with props if needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;render&lt;/strong&gt;: Returns the JSX for the UI (must return a single root element).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;componentDidMount&lt;/strong&gt;: Runs after the component is mounted; often used for data fetching or subscriptions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="updating-methods"&gt;Updating Methods&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;getDerivedStateFromProps&lt;/strong&gt;: Called before every render if props change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;shouldComponentUpdate&lt;/strong&gt;: Determines if a re-render is needed (returns &lt;code&gt;true&lt;/code&gt; by default).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;render&lt;/strong&gt;: Updates the UI based on new state/props.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;getSnapshotBeforeUpdate&lt;/strong&gt;: Captures information from the DOM before changes are applied.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;componentDidUpdate&lt;/strong&gt;: Runs after updates are flushed to the DOM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="unmounting-method"&gt;Unmounting Method&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;componentWillUnmount&lt;/strong&gt;: Used for cleanup (e.g., removing timers or listeners).&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="passing-data-between-components"&gt;Passing Data Between Components&lt;/h2&gt;
&lt;p&gt;Data can be passed between React components in several ways, depending on their relationship.&lt;/p&gt;</description></item><item><title>React Structure</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/002-react-structure/</link><pubDate>Sat, 26 Jul 2025 17:10:07 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/002-react-structure/</guid><description>&lt;p class="lead text-primary"&gt;
This document provides a guide to creating React applications using the Vite build tool. It covers the steps for project creation, explains the advantages of Vite over traditional tools like Create React App, and offers a detailed breakdown of the generated folder and file structure.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-vite-for-react"&gt;Introduction to Vite for React&lt;/h2&gt;
&lt;p&gt;Previously, React projects were often created using the &lt;strong&gt;Create React App (CRA)&lt;/strong&gt; tool. However, &lt;strong&gt;CRA&lt;/strong&gt; can install numerous files and folders that may not be necessary, potentially leading to a large project size.&lt;/p&gt;</description></item><item><title>Components Lifecycle</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/009-components-lifecycle/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/009-components-lifecycle/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the lifecycle of React class components, covering the mounting, updating, and unmounting phases, and the key lifecycle methods available in each phase. It explains how these methods interact with the DOM and how developers can use them to control component behavior.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-component-lifecycle"&gt;Introduction to Component Lifecycle&lt;/h2&gt;
&lt;p&gt;React class components have a lifecycle, meaning they go through distinct phases during their existence. The lifecycle consists of three main phases: mounting, updating, and unmounting. Each phase provides specific lifecycle methods that allow developers to control and respond to changes in the component&amp;rsquo;s relationship with the DOM.&lt;/p&gt;</description></item><item><title>Cra vs Vite</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/005-cra-vs-vite/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/005-cra-vs-vite/</guid><description>&lt;p class="lead text-primary"&gt;
This document provides a structured comparison of Create React App (CRA) and Vite, focusing on their development workflows, build tools, performance, and suitability for different project sizes. It includes setup commands, feature highlights, and a side-by-side table for quick reference.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Modern React development often starts with a build tool that sets up the project structure, handles dependencies, and optimizes the development workflow. Two popular tools for this purpose are Create React App (CRA) and Vite. This document explores their differences, strengths, and use cases.&lt;/p&gt;</description></item><item><title>Frontend Frameworks and React</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/001-frontend-framework/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/001-frontend-framework/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the essentials of front-end frameworks, focusing on the distinction between libraries and frameworks, and provides a comprehensive overview of React. Readers will learn about React's component-based architecture, declarative syntax, virtual DOM, one-way data binding, JSX, and hooks, all of which enable efficient and scalable web application development.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-libraries-and-frameworks"&gt;Introduction to Libraries and Frameworks&lt;/h2&gt;
&lt;p&gt;Libraries and frameworks are foundational tools in software development. A library is a collection of prewritten code that provides reusable functions for specific tasks, allowing developers to integrate them as needed. Examples include jQuery, Lodash, D3.js, and React.&lt;/p&gt;</description></item><item><title>Jsx</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/004-jsx/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/004-jsx/</guid><description>&lt;p class="lead text-primary"&gt;
JSX (JavaScript Syntax Extension) blends HTML-like markup with JavaScript, enabling developers to describe user interfaces in a clear, declarative way. This document covers JSX's syntax, compilation, benefits, and its role in React, with practical examples and comparisons to vanilla JavaScript for building UI components.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-jsx"&gt;Introduction to JSX&lt;/h2&gt;
&lt;p&gt;JSX, or JavaScript Syntax Extension, is a syntax that combines JavaScript with HTML-like markup. It is also known as JavaScript XML. JSX allows developers to describe how user interface elements should appear on the screen using a familiar, readable format. Elements in JSX are enclosed in angle brackets, closely resembling HTML, but can also include JavaScript expressions.&lt;/p&gt;</description></item><item><title>Props and Event Handling</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/007-props-and-event-handling/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/007-props-and-event-handling/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores how React class components use props and event handling to manage state, pass data, and respond to user interactions. It covers class component structure, state management, parent-child data flow, and practical event handling examples for building interactive UIs.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-class-components-props-and-events"&gt;Introduction to Class Components, Props, and Events&lt;/h2&gt;
&lt;p&gt;React class components are JavaScript classes that extend &lt;code&gt;React.Component&lt;/code&gt;. They encapsulate UI logic, manage state, handle lifecycle events, and define methods for user interaction. Before hooks, class components were the primary way to build complex, stateful React UIs.&lt;/p&gt;</description></item><item><title>React Component</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/006-react-component/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/006-react-component/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores React components, the building blocks of React applications. It covers their modular structure, features, types (functional, class, higher-order), and how they manage state, props, and events to create dynamic, reusable user interfaces.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-react-components"&gt;Introduction to React Components&lt;/h2&gt;
&lt;p&gt;React applications are built from modular chunks of code called components. Components break down complex user interfaces into individual, reusable pieces, making development and maintenance easier. Each component can be developed, tested, and managed independently, then composed into parent components to form the complete UI.&lt;/p&gt;</description></item><item><title>React States</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/008-react-states/</link><pubDate>Sat, 26 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/05-frontend-react/01-module/008-react-states/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores state in React class components, including local and shared state, how state enables dynamic UI updates, and the differences between state and props. It provides practical examples and a comparison table for clear understanding.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-state-in-react"&gt;Introduction to State in React&lt;/h2&gt;
&lt;p&gt;State in React is a plain JavaScript object used to represent information about a component&amp;rsquo;s current situation. State allows components to create dynamic and interactive user interfaces by tracking and responding to changes in data.&lt;/p&gt;</description></item></channel></rss>