<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Diego Cachafeiro</title>
    <description>The latest articles on Forem by Diego Cachafeiro (@diegocach).</description>
    <link>https://forem.com/diegocach</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F508513%2F4201d5c4-a2b8-44bb-9366-523168324abf.jpeg</url>
      <title>Forem: Diego Cachafeiro</title>
      <link>https://forem.com/diegocach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/diegocach"/>
    <language>en</language>
    <item>
      <title>HTML Drag and Drop API</title>
      <dc:creator>Diego Cachafeiro</dc:creator>
      <pubDate>Tue, 16 Nov 2021 08:49:11 +0000</pubDate>
      <link>https://forem.com/producthackers/html-drag-and-drop-api-5b81</link>
      <guid>https://forem.com/producthackers/html-drag-and-drop-api-5b81</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Drag and Drop API&lt;/strong&gt; allows you to, as its own name indicates, to create drag and drop interfaces for the users to interact with.&lt;/p&gt;

&lt;p&gt;This API will make available for the users to select elements you allow to with a click, and drag them to the droppable interfaces you also allow them to, this is all customizable you will be able to indicate which elements are draggables and where can be drop into as easy as with some simple functions with some basic functionalities.&lt;/p&gt;

&lt;p&gt;I'll explain to you step by step how to do a simple drag and drop for text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First you need to identify what will be draggable, this can be done by adding the draggable attribute and the ondragstart handler:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
  function dragstart_handler(el) {
    el.dataTransfer.setData("text/plain", el.target.id);
  }

  window.addEventListener('DOMContentLoaded', () =&amp;gt; {
    // Reference to the element we will drag
    const element = document.getElementById("draggable");
    // Add the handler to the div to make it draggable
    element.addEventListener("dragstart", dragstart_handler);
  });
&amp;lt;/script&amp;gt;

&amp;lt;div id="draggable" draggable="true"&amp;gt;You can drag this element.&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After this you need to define what will the draggable object do when you drag it and drop it on the droppable zone, this will be done by creating a function with a dropEffect, there are three dropEffects:

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;copy&lt;/strong&gt; the dragged object will be copied on the droppable zone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;move&lt;/strong&gt; the dragged object will move to the droppable zone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;link&lt;/strong&gt; indicates that some form of relationship or connection will be created between the source and drop locations.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For my example I will use the move dropEffect as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function dragover_handler(el) {
  el.preventDefault();
  el.dataTransfer.dropEffect = "move";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For the last step we need to define a droppable zone, and the function linked to it, in this example we are moving the draggable object into de droppable zone:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
function drop_handler(el) {
 el.preventDefault();
 const data = ev.dataTransfer.getData("text/plain");
 el.target.appendChild(document.getElementById(data));
}
&amp;lt;/script&amp;gt;

&amp;lt;p id="target" ondrop="drop_handler(event)" ondragover="dragover_handler(event)"&amp;gt;Drop Zone&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we combine all the steps we will end up with a code like &lt;a href="https://codepen.io/diegocach/pen/eYEQYeZ"&gt;this codePen&lt;/a&gt; I created for you to test and see how its done, to test it you need to drag the text &lt;em&gt;You can drag this element.&lt;/em&gt; into the text &lt;em&gt;Drop zone&lt;/em&gt; for it to move.&lt;/p&gt;

&lt;p&gt;To finish I will add that this is a little example on how can you use this API, there are many possibilities, for example you can also drag images, and drop them onto the droppable zone, not only text.&lt;/p&gt;

</description>
      <category>html</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Differences between Javascript and Typescript</title>
      <dc:creator>Diego Cachafeiro</dc:creator>
      <pubDate>Fri, 05 Nov 2021 08:37:33 +0000</pubDate>
      <link>https://forem.com/producthackers/differences-between-javascript-and-typescript-32gm</link>
      <guid>https://forem.com/producthackers/differences-between-javascript-and-typescript-32gm</guid>
      <description>&lt;p&gt;In this article we are going to talk about the differences between &lt;strong&gt;Javascript&lt;/strong&gt; and &lt;strong&gt;Typescript&lt;/strong&gt;, they are two languages that are widely use nowadays in all types of projects, JS was the first to be introduced as &lt;strong&gt;client-side&lt;/strong&gt; language. As time passed the projects were JS was being used started to be too complex and heavy, thats were TS enters the game, and starts as language to resolve all the problems that JS was having at the moment, nowadays TS is a language widely used also and is becoming bigger and bigger, so I hope that with this article I can help you a little bit to now any differences or to resolve any doubts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ye2ac0va12y0vmfmo8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ye2ac0va12y0vmfmo8d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many differences, now I'm going to show you a comprehensible list of differences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;JS is used for &lt;strong&gt;client-side&lt;/strong&gt; &lt;em&gt;mostly&lt;/em&gt; while TS is used mostly for both client-side and &lt;strong&gt;server-side&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;TS has an improved &lt;strong&gt;readability&lt;/strong&gt;, since JS requires a lot of manual detection of bugs and errors, this has been improved a lot by TS.&lt;/li&gt;
&lt;li&gt;TS has &lt;strong&gt;static typing&lt;/strong&gt; while JS doesn't support it since JS is a dynamically-typed language.&lt;/li&gt;
&lt;li&gt;TS supports &lt;strong&gt;ES6&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;TS has a full support in modern IDE.&lt;/li&gt;
&lt;li&gt;TS can also convert its code to JS if necessary.&lt;/li&gt;
&lt;li&gt;Using TS means that you can use OOP(Object-oriented programming) principles.&lt;/li&gt;
&lt;li&gt;In JS functions are considered an object and they can have its own method and properties.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The choice is up to you at the end on what to choose if you want to work with this languages, you will have to balance the pros and the cons between both of them, and make an educated choice. Usually the option you choose will come from different variables like having in mind the size and complexity of the project you are going to work on, there are more differences between this two languages but the ones I wrote are the main ones and the important ones, I hope you like the article, any queries feel free to comment and ask!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>JS Iterator objects</title>
      <dc:creator>Diego Cachafeiro</dc:creator>
      <pubDate>Fri, 21 May 2021 08:08:00 +0000</pubDate>
      <link>https://forem.com/producthackers/js-iterator-objects-19ne</link>
      <guid>https://forem.com/producthackers/js-iterator-objects-19ne</guid>
      <description>&lt;p&gt;When we want to iterate through an object we usually fall in the trap (or not) to use always the same iterators, like &lt;code&gt;for&lt;/code&gt; or &lt;code&gt;.map()&lt;/code&gt;, but there is a whole world of &lt;strong&gt;iterators&lt;/strong&gt; in JS each one with their respective functions and differences between each other.&lt;/p&gt;

&lt;p&gt;In this post I will explain to you practical uses and differences between &lt;code&gt;.map()&lt;/code&gt;,&lt;code&gt;.filter()&lt;/code&gt;, &lt;code&gt;.find()&lt;/code&gt;, &lt;code&gt;.reduce()&lt;/code&gt; and &lt;code&gt;.forEach()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Starting  with .map()
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.map()&lt;/code&gt; iterator will go through the elements in the array to &lt;strong&gt;populate&lt;/strong&gt; a new array with the results of the function you provide inside of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array = ["name1", "name2", "name3"];

// pass a function to map
const map = array.map((x, i) =&amp;gt; {
  return x.concat(` surname${i+1}`);
});

console.log(map);
// expected output: Array ["name1 surname1", "name2 surname2", "name3 surname3"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see the &lt;code&gt;.map()&lt;/code&gt; iterator creates a new array populated with what we passed inside of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;code&gt;.filter()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.filter()&lt;/code&gt; iterates through the array and will return a new array populated with the elements that passes the &lt;strong&gt;condition&lt;/strong&gt; provided inside of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array = ["name1", "name2", "name3"];

// pass a function to filter
const filter = array.filter(x =&amp;gt; !x.includes(2));

console.log(map);
// expected output: Array ["name1", "name3"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. &lt;code&gt;.find()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.find()&lt;/code&gt; method will return the &lt;strong&gt;first&lt;/strong&gt; element that passes the condition inside of the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array = ["name1", "name2", "name3"];

// pass a function to filter
const find = array.find(x =&amp;gt; x.includes(2));

console.log(map);
// expected output: Array "name2"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. &lt;code&gt;.reduce()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.reduce()&lt;/code&gt; method will execute a reducer function that you will provide inside of it, this will result in a &lt;strong&gt;single output value&lt;/strong&gt; from the multiple elements inside of the array.&lt;/p&gt;

&lt;p&gt;The reducer function can take four arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accumulator&lt;/li&gt;
&lt;li&gt;Current Value&lt;/li&gt;
&lt;li&gt;Current Index&lt;/li&gt;
&lt;li&gt;Source Array
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const reducer = (sum, val) =&amp;gt; sum + val;
const initialValue = 0;
const arr = [1, 3, 5, 7];

const sumReduce = arr.reduce(reducer, initialValue);
console.log(sumReduce);
// 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. &lt;code&gt;.forEach()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.forEach()&lt;/code&gt; method will execute a function for each one of the elements in the array that iterates.&lt;/p&gt;

&lt;p&gt;In case you are wondering why ever use foreach instead of the other ones, well forEach is more of a &lt;em&gt;generic tool&lt;/em&gt; provided by Js, I'll tell you to use it when you don't have any better and more specific tool as we saw in the previous methods.&lt;/p&gt;

&lt;p&gt;For example, the one that you can confuse it more is with &lt;code&gt;.map()&lt;/code&gt; the difference between them is that map is for modifying the array and returning modified, while &lt;code&gt;.forEach()&lt;/code&gt; can iterate through the array with any necessary modification like just console.log the array.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7kyqqdyrtvhu7ea43vr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7kyqqdyrtvhu7ea43vr.gif" alt="tenor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well I hope this article helped you and provided you with a little more knowledge for your day to day coding, any suggestions or comments are welcome in the comment section.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Improving your web performance</title>
      <dc:creator>Diego Cachafeiro</dc:creator>
      <pubDate>Mon, 22 Mar 2021 09:25:01 +0000</pubDate>
      <link>https://forem.com/producthackers/improving-your-web-performance-ki1</link>
      <guid>https://forem.com/producthackers/improving-your-web-performance-ki1</guid>
      <description>&lt;p&gt;When we are developing, we all want our website to run as well as possible, but the thing is where do I start, or "I think my website is already sufficiently optimized", but there is always something that can be improved and with my post I hope to give you some tips that can improve the performance of your website even if it is only 2% is already a breakthrough, your users will thank you.&lt;br&gt;
I want to emphasize that these are just a few things that you can improve on your website, that can make a big difference but for you it is a simple change.&lt;/p&gt;

&lt;p&gt;The first thing you should know is that, although you have probably already noticed, google has changed its metrics that now become the core web vitals, these new metrics will be taken into account when google shows you in its search engine, the main ones to take into account are these&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjto5rvr7ncctlfp9poo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjto5rvr7ncctlfp9poo.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
All these metrics will appear when you run Lighthouse with chrome, or in &lt;a href="https://developers.google.com/speed/pagespeed/insights/" rel="noopener noreferrer"&gt;pageSpeed Insights&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A small explanation of each of these metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LCP(Largest Contentful Paint)&lt;/strong&gt;: This metric will measure how long it takes to load the largest element of the page we are measuring, which in short measures the load.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FID(First Input Delay)&lt;/strong&gt;: How long it takes for the page to be interactive, it is a metric that measures a good user experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLS(Cumulative Layout Shift)&lt;/strong&gt;: This metric measures the stability of your page, seeing if the elements make your page jump.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having explained all this, we can start with some suggestions.&lt;/p&gt;
&lt;h1&gt;
  
  
  1 . Image optimization
&lt;/h1&gt;

&lt;p&gt;Images are a big enough load for users, and even more if we use high quality images, so the best thing to do in these cases is to find a solution to prevent direct loading as soon as we enter the web.&lt;br&gt;
In case you didn't know, modern browsers are implementing &lt;strong&gt;lazy loading&lt;/strong&gt; natively, in this case the only change you would need to make is to put 'loading="Lazy"' inside your img tag. E.g.:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;&amp;lt;img loading="lazy" /&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;If you want to know which browsers accept this new attribute you can check it out at &lt;a href="https://caniuse.com/loading-lazy-attr" rel="noopener noreferrer"&gt;CanIuse&lt;/a&gt;&lt;br&gt;
In case most of your users use a browser that doesn't have this attribute implemented yet you can always use a &lt;strong&gt;polyfill&lt;/strong&gt;, I recommend this &lt;a href="https://github.com/mfranzke/loading-attribute-polyfill" rel="noopener noreferrer"&gt;Polyfill&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another tip is to always try to set a &lt;strong&gt;width&lt;/strong&gt; and &lt;strong&gt;height&lt;/strong&gt; for the images, and in case you are not able to know what size they will have, you can always put a wrapper that foresees the aspect ratio of your images, and thus not increase the CLS metric by avoiding that when loading the image it makes your page jump. For example in case they have an aspect ratio of 6x4 we can use &lt;code&gt;padding-top: 66.6%&lt;/code&gt;, you can also use the css attribute &lt;code&gt;aspect-ratio: 16 / 9&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxgh2o3b6va51xf62l6gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxgh2o3b6va51xf62l6gn.png" alt="cls-ejemplo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2 . Optimize your web fonts
&lt;/h1&gt;

&lt;p&gt;Use preload when importing your fonts, with the &lt;strong&gt;preload&lt;/strong&gt; attribute you are forcing your user to load the fonts as fast as possible and avoid waiting for each font to load later.&lt;br&gt;
In case you are not using system fonts, check that your fonts are loading fine in all the browsers that your users use, it is something very easy to miss, and maybe this helps you to prevent these little things. In case you see that one of your fonts is not being supported you can always use &lt;strong&gt;WOFF&lt;/strong&gt; fonts as fallback to avoid these situations, &lt;strong&gt;WOFF&lt;/strong&gt; has very good support in all browsers.&lt;/p&gt;

&lt;p&gt;The problem with failing &lt;strong&gt;fonts&lt;/strong&gt;, is that it can cause some &lt;strong&gt;CLS&lt;/strong&gt; in your page, when loading fails makes a shift between the fonts, so is better to always have a fallback that you know is going to work, to dodge those kind of jumps.&lt;/p&gt;

&lt;h1&gt;
  
  
  3 . Remember to keep your code clean
&lt;/h1&gt;

&lt;p&gt;It is a very obvious thing but it is always good to remember it, it is very important to keep your code as clean as possible, like removing loads of code that are not being used, modulate your css files to not make loads where you are not going to use those classes, etc.&lt;/p&gt;

&lt;p&gt;Another thing to keep in mind is the load you are submitting to the user/server with each library you use in your page, try to keep everything as &lt;strong&gt;optimal&lt;/strong&gt; as possible and if you see that you are using a library maybe too heavy for what you use it for, do some research and look for one that is lighter and more adapted to your needs.&lt;/p&gt;

&lt;p&gt;An example of a library that I personally use and is very lightweight is &lt;a href="https://glidejs.com/" rel="noopener noreferrer"&gt;GlideJs&lt;/a&gt;, It gives me exactly what I need with no extra dependencies, and a good API to work with.&lt;/p&gt;

&lt;p&gt;When you have extra things to load, the TTI metric will go up as your webpage is heavier and has more trouble trying to be interactive to your user, here is a graphic that shows you how it works simplified.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9nxixesojumawf479j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9nxixesojumawf479j1.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4 . In case something doesn't fit, look for a creative solution!
&lt;/h1&gt;

&lt;p&gt;This is something abstract, but it is always good to keep your head open to new ideas that maybe you did not know, stay active and looking for new solutions to optimize your website, ask your colleagues and surely you will end up discovering a lot of things you did not know before, not for having more years you will know everything, maybe your newly graduated colleague can bring you a new functionality that you did not know. For example something like the &lt;strong&gt;IntersectionObserver&lt;/strong&gt; is something that is there but I hardly hear about it, if you did not know about this &lt;strong&gt;API&lt;/strong&gt;, I leave you the post of a partner who explains very well how to use it in React: &lt;a href="https://dev.to/producthackers/intersection-observer-using-react-49ko"&gt;Interaction Observer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a little reflection, while working using &lt;strong&gt;ReactJs&lt;/strong&gt; we noticed that our project not being that big was taking a pretty big toll on our web's performance, the problem was coming from doing too much process that wasn't really needed from a framework on the users end, when we could use simple Vanilla Js to control those functionalities, so maybe as another tip consider not using a framework for simple things when not really needed.&lt;/p&gt;

&lt;p&gt;Well, thank you for reading my post and I hope I have taught you a thing or two that will help you in your day to day, if you like this post maybe I will continue with some more suggestions that I can give you. Leave any suggestions you have on the comment section and I will gladly respond to them, or correct me if I'm wrong in some of my suggestions, we are all here to learn!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>webvitals</category>
    </item>
  </channel>
</rss>
