<?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>DEV Community: abhi</title>
    <description>The latest articles on DEV Community by abhi (@abhionly009).</description>
    <link>https://dev.to/abhionly009</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%2F511373%2Fb311211f-96ba-4350-b320-2cde58ffd01d.jpeg</url>
      <title>DEV Community: abhi</title>
      <link>https://dev.to/abhionly009</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhionly009"/>
    <language>en</language>
    <item>
      <title>React without JSX</title>
      <dc:creator>abhi</dc:creator>
      <pubDate>Sat, 24 Dec 2022 18:16:11 +0000</pubDate>
      <link>https://dev.to/abhionly009/react-without-jsx-3g1</link>
      <guid>https://dev.to/abhionly009/react-without-jsx-3g1</guid>
      <description>&lt;p&gt;So here I will show you how to create use react without JSX. when you will go to any tutorial for the first time they will teach you about JSX first and then component and all the cool stuff. &lt;/p&gt;

&lt;p&gt;But do you know that when react was created it was using plain JavaScript object to create components and all...&lt;/p&gt;

&lt;p&gt;We will see that in this session:- &lt;/p&gt;

&lt;p&gt;let's say you have a html file with a div tag like below&lt;br&gt;
   &lt;/p&gt;

&lt;p&gt;now you want to create few element and assign them to root, In plain js will do like this&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const h1 = document.createElement("h1");
h1.innerHTML = "Hello world!";
const root = document.getElementById("root");
root.appendChild(h1);
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;And it will render it on browser perfectly fine.&lt;/p&gt;

&lt;p&gt;Now coming to main topic how we will do the same for react using plain javascript&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const h1 = React.createElement("h1",{},"Hello world");
const root = ReactDOM.createRoot("root");

root.render(h1);
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;hurrah we have create one react element using plain js &lt;/p&gt;

&lt;p&gt;now if you want to add multiple element to root you can do it by simply doing this&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firstName = React.createElement("h2",{id:fName,"abc"};
const lastName = React.createElement("h2",{id:lName,"xyz"};

root.render([firstName,lastName]);
&lt;/code&gt;&lt;/pre&gt;



</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Don't mind it, Bind it Re</title>
      <dc:creator>abhi</dc:creator>
      <pubDate>Tue, 23 Feb 2021 15:45:43 +0000</pubDate>
      <link>https://dev.to/abhionly009/don-t-mind-it-bind-it-re-523o</link>
      <guid>https://dev.to/abhionly009/don-t-mind-it-bind-it-re-523o</guid>
      <description>&lt;p&gt;I have been struggle a lot in order to understand the concept of this,bind,apply and call concepts of javascript.Since I am from Java Background this keyword was bit confusing.&lt;/p&gt;

&lt;p&gt;Here I will explain about call method in neat and clean way....&lt;br&gt;
let's say we have array of objects and wants to apply some method on each and every object&lt;br&gt;
in traditional way we will iterate array and call method and pass argument for every object.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var list = [{ length: 20, breadth: 22 }, { length: 5, breadth: 6 },{ length: 12, breadth: 8 }, { length: 13, breadth: 9 },&lt;br&gt;
    { length: 7, breadth: 4 }];&lt;br&gt;
   function calculateAreaRectangle(length,breadth) {&lt;br&gt;
       console.log(length * breadth);&lt;br&gt;
   }  &lt;br&gt;
   list.forEach(element =&amp;gt; {&lt;br&gt;
    calculateAreaRectangle(element.length,element.breadth);&lt;br&gt;
   })&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;In this example we are calling calculateAreaRectangle() method on each and every obejct by query every object and getting length and breadth.&lt;/p&gt;

&lt;p&gt;It can be done by just passing object which will be refernced as this in calculateAreaRectangle() and inside calculateAreaRectangle use this.length*this.breadth and it will do the same&lt;br&gt;
 &lt;strong&gt;below example will describe it&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var list = [{ length: 20, breadth: 22 }, { length: 5, breadth: 6 },{ length: 12, breadth: 8 }, { length: 13, breadth: 9 },{ length: 7, breadth: 4 }];&lt;br&gt;
function calculateAreaRectangle() {&lt;br&gt;
        console.log(this.length * this.breadth);&lt;br&gt;
}  &lt;br&gt;
list.forEach(element =&amp;gt; {&lt;br&gt;
    calculateAreaRectangle.call(element);&lt;br&gt;
})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BhGpsjCM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vwww2f4t43as19g061bw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BhGpsjCM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vwww2f4t43as19g061bw.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Now let's discuss about &lt;strong&gt;THIS&lt;/strong&gt; keyword we are going to use same example along with global variable length and breadth...&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var length = 3;&lt;br&gt;
   var breadth = 2;&lt;br&gt;
var list = [{ length: 20, breadth: 22 }, { length: 5, breadth: 6 }, { length: 12, breadth: 8 }, { length: 13, breadth: 9 },&lt;br&gt;
    { length: 7, breadth: 4 }];&lt;br&gt;
function calculateAreaRectangle() {&lt;br&gt;
    console.log(this.length * this.breadth);&lt;br&gt;
}  &lt;br&gt;
calculateAreaRectangle(); // it will produce output of 6 because when we will call it will consider global variable as this and since we have length and breadth in global scope it will &lt;br&gt;
calculate and log result, if there is no variable with name of length and breadth in global scope it will throw NaN.&lt;br&gt;
list.forEach(element =&amp;gt; {&lt;br&gt;
    calculateAreaRectangle.call(element);&lt;br&gt;
})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;THANKS FOR READING&lt;/em&gt; &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>codenewbie</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
