<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://mirjabbarbadalov.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 20 Jun 2026 04:58:26 GMT</lastBuildDate><atom:link href="https://mirjabbarbadalov.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building a Weather App:
Exploring React and Redux]]></title><description><![CDATA[Introduction
In the world of web development, creating a practical application that solves real-world problems is an exciting challenge. In this blog post, I want to share my journey of building a weather report app using React and Redux. This projec...]]></description><link>https://mirjabbarbadalov.hashnode.dev/building-a-weather-app-exploring-react-and-redux</link><guid isPermaLink="true">https://mirjabbarbadalov.hashnode.dev/building-a-weather-app-exploring-react-and-redux</guid><category><![CDATA[weatherApp]]></category><category><![CDATA[React]]></category><category><![CDATA[Redux]]></category><category><![CDATA[redux-thunk]]></category><category><![CDATA[APIs]]></category><dc:creator><![CDATA[Mirjabbar Badalov]]></dc:creator><pubDate>Wed, 09 Aug 2023 17:45:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1691602776606/fdd4ee6f-87d4-4416-be77-b9d6b30b8c55.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p>In the world of web development, creating a practical application that solves real-world problems is an exciting challenge. In this blog post, I want to share my journey of building a weather report app using React and Redux. This project allowed me to dive deep into front-end technologies and learn valuable lessons along the way.</p>
<h2 id="heading-project-overview"><strong>Project Overview</strong></h2>
<p>The weather report app I developed provides users with real-time weather information for a given city. It displays the current temperature, humidity, and a brief description of the weather conditions. Users can search for any city and instantly receive the latest weather data.</p>
<h2 id="heading-technologies-used"><strong>Technologies Used</strong></h2>
<p>I decided to build the weather report app using React and Redux due to their powerful combination for managing state and building interactive user interfaces. Additionally, I utilized the Redux Thunk middleware for handling asynchronous actions, which was essential for fetching weather data from an API. For styling I used Sass for getting much more clean styling. I utilized <a target="_blank" href="https://openweathermap.org/api">OpenweatherAPI</a> for data fetching.</p>
<h2 id="heading-challenges-faced"><strong>Challenges Faced</strong></h2>
<p>Throughout the development process, I encountered several challenges. One notable of them was effectively managing asynchronous API calls using Redux Thunk. Learning to structure my actions and reducers to handle loading, success, and error states was a crucial step. At the beginning of the time, it was very hard for me to understand how I have to create a project structure, but after watching 2-3 YouTube videos I clarified it.</p>
<h2 id="heading-some-screenshots-from-a-file-structure">Some screenshots from a file structure</h2>
<h3 id="heading-redux-part-file-structure">Redux part file structure:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691600215207/5fc62818-f7ae-4d5b-869c-f60a1af0df57.jpeg" alt="redux file structure" class="image--center mx-auto" /></p>
<h3 id="heading-react-components">React components:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691600512622/3d3eb881-a6a0-4627-b2bc-c6d531f1ab4d.jpeg" alt class="image--center mx-auto" /></p>
<h3 id="heading-styling-part">Styling part:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691600538970/35d1d283-2a52-48f3-89ab-919d60ac595b.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-development-process"><strong>Development Process</strong></h2>
<p>I followed a component-based architecture in React, breaking down the user interface into reusable components. This allowed me to keep my codebase organized and maintainable. In this part, I followed some important steps:</p>
<ul>
<li><p>Created Redux action types (e.g., FETCH_WEATHER_REQUEST, FETCH_WEATHER_SUCCESS, FETCH_WEATHER_FAILURE).<br />  Implemented action creators for these actions.</p>
</li>
<li><p>Created a Redux Thunk action to fetch weather data.<br />  Used <code>async/await</code> function to make API requests to <a target="_blank" href="https://openweathermap.org/api">OpenWeatherMap</a>.</p>
</li>
<li><p>In the search bar component, create an input field where users can type a location. Added a button that users will click to initiate the weather search.</p>
</li>
<li><p>Attached is an event handler to the search button.<br />  When the button is clicked, dispatch the Redux Thunk action to fetch weather data using the input value.</p>
</li>
<li><p>Updated the weather display component to show fetched weather information.<br />  Displayed temperature, weather description, and an icon based on the condition.</p>
</li>
<li><p>Handled API request errors and display error messages to users. When a request gives an error, an error message is shown in the component.</p>
</li>
<li><p>Handle API request loading and display loading messages to users. In this part I used ready HTML/CSS written Loading animation.</p>
<p>  I utilized this loader: <a target="_blank" href="https://uiverse.io/zanina-yassine/weak-bobcat-68">UI Verse Loader</a></p>
</li>
</ul>
<h2 id="heading-app-ui"><strong>App UI</strong></h2>
<h3 id="heading-loading-screen">Loading screen:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691602242508/341eca62-8da8-4b4f-ac97-39a032e96b19.jpeg" alt class="image--center mx-auto" /></p>
<h3 id="heading-success-screen">Success screen:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691602290605/e6b9fad5-5a3b-48c9-95ea-16334d123258.jpeg" alt class="image--center mx-auto" /></p>
<h3 id="heading-error-screen">Error screen:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691602319121/f223471d-abe9-4f41-bf9c-3afe3b8dfe16.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-key-takeaways"><strong>Key Takeaways</strong></h2>
<ol>
<li><p><strong>Redux State Management:</strong> Implementing Redux for state management taught me the importance of centralizing and controlling application data. It also provided a clear way to handle asynchronous operations while maintaining a predictable state.</p>
</li>
<li><p><strong>Asynchronous Actions:</strong> Working with Redux Thunk gave me insight into managing asynchronous actions. This was particularly valuable when fetching weather data from an external API.</p>
</li>
<li><p><strong>Code Structure:</strong> Organizing the project into modular components not only enhanced the readability of the code but also simplified debugging and maintenance.</p>
</li>
</ol>
<h2 id="heading-code-highlights"><strong>Code Highlights</strong></h2>
<h3 id="heading-main-store-file-indexjs">Main store file, index.js:</h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//main store file: index.js</span>

<span class="hljs-keyword">import</span> { createStore, applyMiddleware, compose } <span class="hljs-keyword">from</span> <span class="hljs-string">"redux"</span>;
<span class="hljs-keyword">import</span> rootReducer <span class="hljs-keyword">from</span> <span class="hljs-string">"./reducers"</span>;

<span class="hljs-keyword">import</span> thunkMiddleware <span class="hljs-keyword">from</span> <span class="hljs-string">"redux-thunk"</span>;

<span class="hljs-keyword">const</span> env = <span class="hljs-string">"developement"</span>;
<span class="hljs-keyword">const</span> composeEnhancers =
  env === <span class="hljs-string">"developement"</span>
    ? <span class="hljs-built_in">window</span>.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
    : compose;

<span class="hljs-keyword">const</span> store = createStore(
  rootReducer,
  composeEnhancers(applyMiddleware(thunkMiddleware))
);

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> store;
</code></pre>
<h3 id="heading-reducers-part">Reducers part:</h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//Reducers part:</span>
<span class="hljs-keyword">const</span> initialState = {
  <span class="hljs-attr">data</span>: [],
  <span class="hljs-attr">loading</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">error</span>: <span class="hljs-literal">false</span>,
  <span class="hljs-attr">errorMessage</span>: <span class="hljs-literal">null</span>,
  <span class="hljs-attr">success</span>: <span class="hljs-literal">false</span>,
};
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> weatherReducer = <span class="hljs-function">(<span class="hljs-params">state = initialState, action</span>) =&gt;</span> {
  <span class="hljs-keyword">switch</span> (action.type) {
    <span class="hljs-keyword">case</span> <span class="hljs-string">"FETCH_WEATHER_REQUEST"</span>:
      <span class="hljs-keyword">return</span> {
        ...state,
        <span class="hljs-attr">success</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-attr">loading</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-attr">error</span>: <span class="hljs-literal">false</span>,
      };

    <span class="hljs-keyword">case</span> <span class="hljs-string">"FETCH_WEATHER_SUCCESS"</span>:
      <span class="hljs-keyword">return</span> {
        ...state,
        <span class="hljs-attr">loading</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-attr">data</span>: action.payload,
        <span class="hljs-attr">error</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-attr">success</span>: <span class="hljs-literal">true</span>,
      };

    <span class="hljs-keyword">case</span> <span class="hljs-string">"FETCH_WEATHER_FAILURE"</span>:
      <span class="hljs-keyword">return</span> {
        ...state,
        <span class="hljs-attr">error</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-attr">data</span>: [],
        <span class="hljs-attr">loading</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-attr">errorMessage</span>: action.payload,
        <span class="hljs-attr">success</span>: <span class="hljs-literal">false</span>,
      };

    <span class="hljs-keyword">default</span>:
      <span class="hljs-keyword">return</span> state;
  }
};

<span class="hljs-comment">//Instead of one reducer, I created root reducer:</span>
<span class="hljs-keyword">import</span> { combineReducers } <span class="hljs-keyword">from</span> <span class="hljs-string">"redux"</span>;
<span class="hljs-keyword">import</span> { weatherReducer } <span class="hljs-keyword">from</span> <span class="hljs-string">"./weather"</span>;

<span class="hljs-keyword">const</span> rootReducer = combineReducers({
  <span class="hljs-attr">weather</span>: weatherReducer,
});

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> rootReducer;
</code></pre>
<h3 id="heading-actions-part">Actions part:</h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> FETCH_WEATHER_REQUEST = <span class="hljs-string">"FETCH_WEATHER_REQUEST"</span>;
<span class="hljs-keyword">const</span> FETCH_WEATHER_SUCCESS = <span class="hljs-string">"FETCH_WEATHER_SUCCESS"</span>;
<span class="hljs-keyword">const</span> FETCH_WEATHER_FAILURE = <span class="hljs-string">"FETCH_WEATHER_FAILURE"</span>;

<span class="hljs-keyword">import</span> API_KEY <span class="hljs-keyword">from</span> <span class="hljs-string">"../../apikey"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> fetchPosts = <span class="hljs-function">(<span class="hljs-params">location</span>) =&gt;</span> {
  <span class="hljs-keyword">return</span> <span class="hljs-keyword">async</span> (dispatch) =&gt; {
    dispatch({
      <span class="hljs-attr">type</span>: FETCH_WEATHER_REQUEST,
    });

    <span class="hljs-keyword">try</span> {
      <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(
        <span class="hljs-string">`https://api.openweathermap.org/data/2.5/weather?appid=<span class="hljs-subst">${API_KEY}</span>&amp;q=<span class="hljs-subst">${location}</span>&amp;units=metric`</span>
      );
      <span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> response.json();
      <span class="hljs-comment">// console.log(data);</span>
      dispatch({
        <span class="hljs-attr">type</span>: FETCH_WEATHER_SUCCESS,
        <span class="hljs-attr">payload</span>: data,
      });

      <span class="hljs-keyword">if</span> (data.cod !== <span class="hljs-number">200</span>) {
        dispatch({
          <span class="hljs-attr">type</span>: FETCH_WEATHER_FAILURE,
          <span class="hljs-attr">payload</span>: data.message,
        });
      }
    } <span class="hljs-keyword">catch</span> (error) {
      dispatch({
        <span class="hljs-attr">type</span>: FETCH_WEATHER_FAILURE,
      });
    }
  };
};
</code></pre>
<h3 id="heading-searchjs-file">Search.js file:</h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> React, { useState } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> { fetchPosts } <span class="hljs-keyword">from</span> <span class="hljs-string">"../store/actions/weatherActions"</span>;
<span class="hljs-keyword">import</span> { useDispatch } <span class="hljs-keyword">from</span> <span class="hljs-string">"react-redux"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Search</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [inputVal, setInputVal] = useState(<span class="hljs-string">"Baku"</span>);
  <span class="hljs-keyword">const</span> dispatch = useDispatch();

  <span class="hljs-keyword">const</span> sendRequest = <span class="hljs-function">() =&gt;</span> {
    dispatch(fetchPosts(inputVal));
  };

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"search-box"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span>
        <span class="hljs-attr">className</span>=<span class="hljs-string">"search-box--input"</span>
        <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span>
        <span class="hljs-attr">placeholder</span>=<span class="hljs-string">"search "</span>
        <span class="hljs-attr">value</span>=<span class="hljs-string">{inputVal}</span>
        <span class="hljs-attr">onChange</span>=<span class="hljs-string">{(e)</span> =&gt;</span> {
          setInputVal(e.target.value);
        }}
      /&gt;
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"search-box--btn"</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{sendRequest}</span>&gt;</span>
        Search
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<h2 id="heading-lessons-learned">Lessons learned</h2>
<p>Reflecting on this project, I realized the significance of planning before diving into coding. Creating a clear roadmap and understanding the flow of data in Redux proved essential. I also learned to embrace challenges as learning opportunities, which ultimately led to a more robust application</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Building the weather report app was an enriching experience that deepened my understanding of React, Redux, and asynchronous programming. The satisfaction of seeing a functional application come to life from scratch is truly rewarding. If you're looking to expand your front-end development skills, consider taking on a project that piques your interest and challenges you to grow.</p>
<p>Connect with me on <a target="_blank" href="https://github.com/mirjabbarbadalov"><strong>GitHub</strong></a> and feel free to explore the live demo of the <a target="_blank" href="https://dazzling-taffy-8418ed.netlify.app/"><strong>Weather Report App</strong>!</a></p>
]]></content:encoded></item><item><title><![CDATA[Building a Movies App with Basic React Knowledge: My Journey and Insights]]></title><description><![CDATA[Introduction


Hello, fellow developers! My name is Mirjabbar, and I'm excited to share my experience of creating a movie app using basic React knowledge. As someone relatively new to React, I wanted to challenge myself and build a simple yet functio...]]></description><link>https://mirjabbarbadalov.hashnode.dev/building-a-movies-app-with-basic-react-knowledge-my-journey-and-insights</link><guid isPermaLink="true">https://mirjabbarbadalov.hashnode.dev/building-a-movies-app-with-basic-react-knowledge-my-journey-and-insights</guid><category><![CDATA[React]]></category><category><![CDATA[Movies]]></category><category><![CDATA[projects]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[full stack]]></category><dc:creator><![CDATA[Mirjabbar Badalov]]></dc:creator><pubDate>Mon, 31 Jul 2023 17:53:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/vc3iVL_znJ8/upload/76a71c011a298b512e07bc70db4cd61c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<ul>
<li><h2 id="heading-introduction"><strong>Introduction</strong></h2>
</li>
</ul>
<p>Hello, fellow developers! My name is Mirjabbar, and I'm excited to share my experience of creating a movie app using basic React knowledge. As someone relatively new to React, I wanted to challenge myself and build a simple yet functional app that allows users to browse and search for their favorite movies. Let's dive into the journey of how I created this app and the lessons I learned along the way.</p>
<ul>
<li><h3 id="heading-project-overview-tasks"><strong>Project Overview / Tasks</strong></h3>
</li>
</ul>
<p>The goal of my movies app was to provide users with a user-friendly interface to explore a vast collection of movies. Key features of the app include:</p>
<ol>
<li><p>Sign up on <a target="_blank" href="https://www.omdbapi.com/">www.omdbapi.com</a> to get an API key for accessing movie data.</p>
</li>
<li><p>Use Postman to explore the API request and response to understand the data structure.</p>
</li>
<li><p>Create a new React project and install necessary dependencies, including react-icons, react-router-dom and sass.</p>
</li>
<li><p>Set up a state in your React component to store the list of movies.</p>
</li>
<li><p>Display the list of movies in your application using components and JSX.</p>
</li>
<li><p>Implement a scroll effect to improve the user experience while browsing through movies.</p>
</li>
<li><p>Use React Router to create pages for different sections of your movie application.</p>
</li>
<li><p>Implement active link logic to highlight the currently active page in the navigation.</p>
</li>
<li><p>Call the <a target="_blank" href="https://www.omdbapi.com/">OMDB API</a> from your React application to fetch movie data using the API key. Use Promises for handling asynchronous requests.</p>
</li>
<li><p>Add a loading state or loaders to display feedback while the data is being fetched from the API.</p>
</li>
<li><p>Add a hover effect and favorites icon to make movie items interactive.</p>
</li>
<li><p>Implement the functionality to save movies to the favorites list.</p>
</li>
<li><p>Allow users to remove movies from the favorites list.</p>
</li>
<li><p>Use local storage to store the favorites list data in the browser.</p>
</li>
<li><p>Retrieve the favorites list from local storage when the app loads to maintain user preferences.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690825480266/5fc757cc-f675-4105-af34-fe26cd647888.jpeg" alt="Finished image of project" class="image--center mx-auto" /></p>
<ul>
<li><h3 id="heading-technologies-used"><strong>Technologies Used</strong></h3>
</li>
</ul>
<p>For this project, I utilized the following technologies and tools:</p>
<ol>
<li><p>React: As the core frontend library to build the user interface.</p>
</li>
<li><p>SCSS: For styling the app's layout.</p>
</li>
<li><p>OMDb API. The Open Movie Database.</p>
</li>
<li><p>Visual Studio Code: My code editor of choice.</p>
</li>
</ol>
<ul>
<li><h3 id="heading-development-process">Development Process</h3>
</li>
</ul>
<ol>
<li><p><strong>Setting Up the Project:</strong> I began by creating a new React app using</p>
<p> <code>npm create vite@latest</code> to scaffold the initial project structure.</p>
</li>
<li><p><strong>Fetching Movie Data:</strong> To display movie information, I integrated the OMDb API into my app and used <code>async/await</code> syntax to make API requests and fetch movie data. This approach simplified the code and made it easier to handle asynchronous operations.</p>
</li>
<li><p><strong>Designing the UI:</strong> I focused on creating a clean and intuitive user interface. React's component-based structure allowed me to organize and reuse UI elements efficiently. I divided the project structure into small and reusable components, so it made it easier to upgrade this code.</p>
</li>
<li><p><strong>Implementing the Routing Pages:</strong> For routing pages, I used <code>react-router-dom</code></p>
<p> I created a pages folder for making easier the process of page changing.</p>
</li>
<li><p><strong>Implementing the Search Functionality:</strong> For this part I used React state and event handling to capture user input and trigger movie searches.</p>
</li>
<li><p><strong>Implementing the Add to Favorites Functionality:</strong> This was a challenging part for me as a beginner. If user clicks <code>Add to favorites</code> button proper movie sent to <code>favoriteMovies</code> array and also it stores its information in <code>localStorage</code> . This part was new for me, but it was easy for handling info inside <code>localStorage</code> . If selected movie has already been added to the favorites user clicks and movie data deletes from storage.</p>
</li>
<li><p><strong>Implementing the Favorites page:</strong> For this part, if the user goes to the favorites page, there is no need for a new API request, it is very bad for the performance of the app. So on the favorites page, movies' data comes from local storage.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690825629885/bec22f32-c4d0-4e7b-b01f-434e8fa648c1.jpeg" alt class="image--center mx-auto" /></p>
<ul>
<li><h3 id="heading-key-learnings"><strong>Key Learnings</strong></h3>
</li>
</ul>
<p>Throughout this project, I gained several valuable insights:</p>
<ol>
<li><p><strong>React Fundamentals:</strong> Building this app strengthened my understanding of React components, props, state, and event handling.</p>
</li>
<li><p><strong>API Integration:</strong> Integrating external APIs can be challenging, but it's a crucial skill for building dynamic apps.</p>
</li>
<li><p><strong>UI/UX Design:</strong> Design plays a vital role in creating user-friendly apps. I learned about layout design, typography, and color schemes.</p>
</li>
</ol>
<ul>
<li><h3 id="heading-code-samples"><strong>Code Samples</strong></h3>
</li>
</ul>
<p><em>Search Component - Handling User Input:</em></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Search</span>(<span class="hljs-params">{ movieInput, setMovieInput }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"search--box"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span>
        <span class="hljs-attr">className</span>=<span class="hljs-string">"search--box-input"</span>
        <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span>
        <span class="hljs-attr">placeholder</span>=<span class="hljs-string">"search movie"</span>
        <span class="hljs-attr">value</span>=<span class="hljs-string">{movieInput}</span>
        <span class="hljs-attr">onChange</span>=<span class="hljs-string">{(e)</span> =&gt;</span> {
          setMovieInput(e.target.value);
        }}
      /&gt;
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p><em>Movie Component - Handling Favorites State:</em></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> isFavorite = favoriteMovies.some(<span class="hljs-function">(<span class="hljs-params">movie</span>) =&gt;</span> movie.Title === Title);

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handleFavorites</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">if</span> (isFavorite) {
      <span class="hljs-keyword">const</span> updatedFavorites = favoriteMovies.filter(
        <span class="hljs-function">(<span class="hljs-params">movie</span>) =&gt;</span> movie.Title !== Title
      );
      setFavoriteMovies(updatedFavorites);
    } <span class="hljs-keyword">else</span> {
      setFavoriteMovies([newFav, ...favoriteMovies]);
    }
  }
</code></pre>
<p><em>Fetching data, and sending it to local storage:</em></p>
<pre><code class="lang-javascript">useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">localStorage</span>.setItem(<span class="hljs-string">"favorites"</span>, <span class="hljs-built_in">JSON</span>.stringify(favoriteMovies));
  }, [favoriteMovies]);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">const</span> localValuesGet = <span class="hljs-built_in">JSON</span>.parse(<span class="hljs-built_in">localStorage</span>.getItem(<span class="hljs-string">"favorites"</span>));
    setStoredFavorites(localValuesGet);
  }, [favoriteMovies]);

  <span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getMovies</span>(<span class="hljs-params">url</span>) </span>{
    <span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> fetch(url);
    <span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> data.json();
    setMovies(res);
  }

  useEffect(<span class="hljs-function">() =&gt;</span> {
    getMovies(<span class="hljs-string">`http://www.omdbapi.com/?s=<span class="hljs-subst">${movieInput}</span>&amp;apikey=738237a0`</span>);
  }, [movieInput]);
</code></pre>
<ul>
<li><h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
</li>
</ul>
<p>Building the movie app with basic React knowledge was a fulfilling experience. It allowed me to apply what I learned and push my boundaries as a developer. I hope my journey inspires you to take on your projects and continue learning.</p>
<p>Feel free to check out the the code on <a target="_blank" href="https://github.com/mirjabbarbadalov/movies-app"><strong>GitHub</strong>.</a></p>
<p>Happy coding!</p>
]]></content:encoded></item></channel></rss>