<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>React on Ghafoor's Personal Blog</title><link>http://ghafoorsblog.com/categories/react/</link><description>Recent content in React 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:30:40 +0100</lastBuildDate><atom:link href="http://ghafoorsblog.com/categories/react/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></channel></rss>