{"id":668,"date":"2025-05-18T19:05:52","date_gmt":"2025-05-18T19:05:52","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=668"},"modified":"2025-05-20T12:57:52","modified_gmt":"2025-05-20T12:57:52","slug":"data-fetching-and-side-effects","status":"publish","type":"post","link":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/","title":{"rendered":"Data Fetching and Side Effects"},"content":{"rendered":"<h2>Fetching data using fetch and Axios<\/h2>\n<p>Data fetching is a core part of building dynamic web applications. In React, two common approaches for making HTTP requests are the native <code>fetch<\/code> API and the third-party library <code>Axios<\/code>. Both allow you to retrieve data from external sources like APIs and integrate it into your application.<\/p>\n<h3>Using the Fetch API<\/h3>\n<p>The Fetch API is built into modern browsers and provides a promise-based approach to making HTTP requests. It is lightweight and doesn\u2019t require any external dependencies.<\/p>\n<ul>\n<li>Supports all common HTTP methods (GET, POST, PUT, DELETE)<\/li>\n<li>Returns a <code>Response<\/code> object which needs to be parsed using <code>response.json()<\/code><\/li>\n<li>Requires manual handling of request headers, response parsing, and error checking<\/li>\n<\/ul>\n<p><strong>Advantages of Fetch<\/strong><\/p>\n<ul>\n<li>No installation required<\/li>\n<li>Native browser support<\/li>\n<li>Lightweight and minimal<\/li>\n<\/ul>\n<p><strong>Limitations of Fetch<\/strong><\/p>\n<ul>\n<li>No built-in support for request cancellation<\/li>\n<li>Less intuitive error handling<\/li>\n<li>Requires more boilerplate for complex requests<\/li>\n<\/ul>\n<h3>Using Axios<\/h3>\n<p>Axios is a popular HTTP client library that simplifies the process of making HTTP requests in React. It offers additional features compared to Fetch and is preferred for larger or more complex applications.<\/p>\n<ul>\n<li>Automatically parses JSON responses<\/li>\n<li>Supports interceptors for request and response<\/li>\n<li>Has built-in support for timeouts and request cancellation<\/li>\n<li>Provides a cleaner syntax for sending data with requests<\/li>\n<\/ul>\n<p><strong>Advantages of Axios<\/strong><\/p>\n<ul>\n<li>Easier to use and more concise syntax<\/li>\n<li>Better error handling out of the box<\/li>\n<li>Supports request\/response transformations and interceptors<\/li>\n<\/ul>\n<p><strong>When to Use Fetch or Axios<\/strong><\/p>\n<ul>\n<li>Use Fetch for basic or small projects with minimal configuration needs<\/li>\n<li>Use Axios when working with complex APIs or requiring features like interceptors, cancellation, or automatic response parsing<\/li>\n<\/ul>\n<p>Both Fetch and Axios are effective for data fetching in React. The choice depends on project complexity, developer preference, and the specific features required by the application.<\/p>\n<h2>Managing loading and error states<\/h2>\n<p>Handling loading and error states is crucial for creating a smooth user experience when fetching data or performing asynchronous operations in React applications.<\/p>\n<h3>Why Manage Loading and Error States<\/h3>\n<p>Users need feedback while data is being retrieved or processed. Showing loading indicators prevents confusion, while displaying error messages helps users understand problems and take action.<\/p>\n<p><strong>Common Approach<\/strong><\/p>\n<ul>\n<li>Create state variables to track loading and error status (e.g., <code>isLoading<\/code> and <code>error<\/code>)<\/li>\n<li>Set <code>isLoading<\/code> to true before starting a fetch or async task<\/li>\n<li>Clear the error state before or during the operation<\/li>\n<li>Update <code>isLoading<\/code> to false when the operation completes<\/li>\n<li>Set the <code>error<\/code> state if an error occurs during the operation<\/li>\n<\/ul>\n<p><strong>Example Workflow<\/strong><\/p>\n<ul>\n<li>User triggers data fetch<\/li>\n<li>Set loading state to true, clear previous errors<\/li>\n<li>Fetch data asynchronously<\/li>\n<li>If successful, update data and set loading to false<\/li>\n<li>If error, capture and display error message, set loading to false<\/li>\n<\/ul>\n<p><strong>UI Feedback Patterns<\/strong><\/p>\n<ul>\n<li>Show a spinner or loading message while <code>isLoading<\/code> is true<\/li>\n<li>Display error alerts or messages when <code>error<\/code> state is set<\/li>\n<li>Render data or main content only when loading is complete and no errors exist<\/li>\n<\/ul>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Keep loading and error state close to the component that manages data fetching<\/li>\n<li>Handle edge cases such as empty data or slow network gracefully<\/li>\n<li>Clear error state on retry or new attempts to avoid stale messages<\/li>\n<li>Use consistent UI elements for loading and error states across the app<\/li>\n<\/ul>\n<p>Managing loading and error states effectively improves the usability and professionalism of React applications by keeping users informed during asynchronous processes.<\/p>\n<h2>Using async\/await in React<\/h2>\n<p>Async\/await is a modern JavaScript syntax for handling asynchronous operations in a more readable and straightforward way. In React, it is commonly used for fetching data, performing side effects, or handling promises inside components.<\/p>\n<h3>Why Use Async\/Await<\/h3>\n<p>Async\/await allows you to write asynchronous code that looks synchronous, improving code clarity and reducing callback nesting compared to traditional promise chains.<\/p>\n<p><strong>Using Async\/Await with useEffect<\/strong><\/p>\n<p>Since React\u2019s <code>useEffect<\/code> hook callback cannot be async directly, you typically define an inner async function and call it immediately to handle async operations like data fetching.<\/p>\n<p><strong>Example Pattern<\/strong><\/p>\n<ul>\n<li>Define an async function inside the effect<\/li>\n<li>Use <code>await<\/code> to pause execution until the promise resolves<\/li>\n<li>Handle results or errors with try\/catch blocks<\/li>\n<li>Call the async function inside the effect<\/li>\n<\/ul>\n<p><strong>Benefits<\/strong><\/p>\n<ul>\n<li>Cleaner, easier-to-read asynchronous code<\/li>\n<li>Improved error handling with try\/catch<\/li>\n<li>Better control over sequential async operations<\/li>\n<\/ul>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Avoid making the main effect function async directly<\/li>\n<li>Cancel ongoing async tasks if the component unmounts to prevent memory leaks<\/li>\n<li>Use loading and error states to provide user feedback during async calls<\/li>\n<\/ul>\n<p>Using async\/await in React simplifies asynchronous logic, especially for data fetching, making components more maintainable and readable.<\/p>\n<h2>Introduction to React Query or SWR<\/h2>\n<p>React Query and SWR are popular libraries designed to simplify data fetching, caching, and synchronization in React applications. They provide powerful tools for managing server state, reducing boilerplate, and improving performance.<\/p>\n<h3>What Is React Query<\/h3>\n<p>React Query is a data-fetching library that handles asynchronous operations, caching, background updates, and state synchronization out of the box. It focuses on improving the developer experience with features like automatic retries, pagination, and query invalidation.<\/p>\n<h3>What Is SWR<\/h3>\n<p>SWR (stale-while-revalidate) is a React Hooks library developed by Vercel that optimizes data fetching by returning cached data first and then revalidating it in the background for fresh content. It emphasizes simplicity, speed, and real-time data updates.<\/p>\n<p><strong>Key Features of React Query and SWR<\/strong><\/p>\n<ul>\n<li>Automatic caching and cache invalidation<\/li>\n<li>Background data refetching for freshness<\/li>\n<li>Built-in loading and error state management<\/li>\n<li>Support for pagination and infinite scrolling<\/li>\n<li>Focus on performance and minimizing unnecessary requests<\/li>\n<\/ul>\n<p><strong>Benefits<\/strong><\/p>\n<ul>\n<li>Reduces the complexity of data fetching logic<\/li>\n<li>Improves app responsiveness and UX with caching<\/li>\n<li>Makes server state management easier and more predictable<\/li>\n<li>Provides hooks-based API for seamless React integration<\/li>\n<\/ul>\n<p><strong>When to Use Them<\/strong><\/p>\n<p>Use React Query or SWR when building applications that require frequent or complex data fetching, real-time updates, or offline support, and when you want to avoid writing custom state management and caching logic.<\/p>\n<p>Both libraries enhance React apps by abstracting common data fetching challenges, helping developers write cleaner and more efficient code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fetching data using fetch and Axios Data fetching is a core part of building dynamic web applications. In React, two common approaches for making HTTP requests are the native fetch API and the third-party library Axios. Both allow you to retrieve data from external sources<\/p>\n","protected":false},"author":1,"featured_media":669,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Fetching and Side Effects - React Course<\/title>\n<meta name=\"description\" content=\"Data fetching and side effects manage asynchronous operations and external interactions within React components.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Fetching and Side Effects - React Course\" \/>\n<meta property=\"og:description\" content=\"Data fetching and side effects manage asynchronous operations and external interactions within React components.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/\" \/>\n<meta property=\"og:site_name\" content=\"BUHAVE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BeYouHave\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/naveedsafdarawan\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-18T19:05:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-20T12:57:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Naveed Safdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Safdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/\"},\"author\":{\"name\":\"Naveed Safdar\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\"},\"headline\":\"Data Fetching and Side Effects\",\"datePublished\":\"2025-05-18T19:05:52+00:00\",\"dateModified\":\"2025-05-20T12:57:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/\"},\"wordCount\":985,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Data-Fetching-and-Side-Effects.webp\",\"articleSection\":[\"React Course\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/\",\"name\":\"Data Fetching and Side Effects - React Course\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Data-Fetching-and-Side-Effects.webp\",\"datePublished\":\"2025-05-18T19:05:52+00:00\",\"dateModified\":\"2025-05-20T12:57:52+00:00\",\"description\":\"Data fetching and side effects manage asynchronous operations and external interactions within React components.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Data-Fetching-and-Side-Effects.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Data-Fetching-and-Side-Effects.webp\",\"width\":1200,\"height\":628,\"caption\":\"Data Fetching and Side Effects\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/data-fetching-and-side-effects\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React Course\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/learn\\\/react\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Data Fetching and Side Effects\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"name\":\"BUHAVE\",\"description\":\"Courses - Learn Online for Free\",\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buhave.com\\\/courses\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\",\"name\":\"BUHAVE\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"width\":375,\"height\":75,\"caption\":\"BUHAVE\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BeYouHave\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/buhave\",\"https:\\\/\\\/www.youtube.com\\\/@buhave\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\",\"name\":\"Naveed Safdar\",\"description\":\"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedsafdar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/naveedsafdarawan\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@naveedsafdar\"],\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/author\\\/naveed-safdar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Fetching and Side Effects - React Course","description":"Data fetching and side effects manage asynchronous operations and external interactions within React components.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/","og_locale":"en_US","og_type":"article","og_title":"Data Fetching and Side Effects - React Course","og_description":"Data fetching and side effects manage asynchronous operations and external interactions within React components.","og_url":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/","og_site_name":"BUHAVE","article_publisher":"https:\/\/www.facebook.com\/BeYouHave\/","article_author":"https:\/\/www.facebook.com\/naveedsafdarawan\/","article_published_time":"2025-05-18T19:05:52+00:00","article_modified_time":"2025-05-20T12:57:52+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp","type":"image\/webp"}],"author":"Naveed Safdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Safdar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#article","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/"},"author":{"name":"Naveed Safdar","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca"},"headline":"Data Fetching and Side Effects","datePublished":"2025-05-18T19:05:52+00:00","dateModified":"2025-05-20T12:57:52+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/"},"wordCount":985,"commentCount":0,"publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"image":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp","articleSection":["React Course"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/","url":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/","name":"Data Fetching and Side Effects - React Course","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#primaryimage"},"image":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp","datePublished":"2025-05-18T19:05:52+00:00","dateModified":"2025-05-20T12:57:52+00:00","description":"Data fetching and side effects manage asynchronous operations and external interactions within React components.","breadcrumb":{"@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#primaryimage","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/Data-Fetching-and-Side-Effects.webp","width":1200,"height":628,"caption":"Data Fetching and Side Effects"},{"@type":"BreadcrumbList","@id":"https:\/\/buhave.com\/courses\/react\/data-fetching-and-side-effects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Courses","item":"https:\/\/buhave.com\/courses\/"},{"@type":"ListItem","position":2,"name":"React Course","item":"https:\/\/buhave.com\/courses\/learn\/react\/"},{"@type":"ListItem","position":3,"name":"Data Fetching and Side Effects"}]},{"@type":"WebSite","@id":"https:\/\/buhave.com\/courses\/#website","url":"https:\/\/buhave.com\/courses\/","name":"BUHAVE","description":"Courses - Learn Online for Free","publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buhave.com\/courses\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/buhave.com\/courses\/#organization","name":"BUHAVE","url":"https:\/\/buhave.com\/courses\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","width":375,"height":75,"caption":"BUHAVE"},"image":{"@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BeYouHave\/","https:\/\/www.linkedin.com\/company\/buhave","https:\/\/www.youtube.com\/@buhave"]},{"@type":"Person","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca","name":"Naveed Safdar","description":"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.","sameAs":["https:\/\/www.linkedin.com\/in\/naveedsafdar\/","https:\/\/www.facebook.com\/naveedsafdarawan\/","https:\/\/www.youtube.com\/@naveedsafdar"],"url":"https:\/\/buhave.com\/courses\/author\/naveed-safdar\/"}]}},"_links":{"self":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/comments?post=668"}],"version-history":[{"count":1,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/668\/revisions"}],"predecessor-version":[{"id":670,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/668\/revisions\/670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media\/669"}],"wp:attachment":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media?parent=668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/categories?post=668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/tags?post=668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}