<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Venkata Naga Kailash Anantha on Medium]]></title>
        <description><![CDATA[Stories by Venkata Naga Kailash Anantha on Medium]]></description>
        <link>https://medium.com/@avnkailash?source=rss-abcd167c571a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PMOrieMyY_jmMlQ5eRBeHA.jpeg</url>
            <title>Stories by Venkata Naga Kailash Anantha on Medium</title>
            <link>https://medium.com/@avnkailash?source=rss-abcd167c571a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:00:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avnkailash/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React.Js Series: Getting to know React]]></title>
            <link>https://medium.com/@avnkailash/react-js-series-getting-to-know-react-7b2204d7731c?source=rss-abcd167c571a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b2204d7731c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Venkata Naga Kailash Anantha]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 18:09:05 GMT</pubDate>
            <atom:updated>2022-02-25T18:09:05.362Z</atom:updated>
            <content:encoded><![CDATA[<p>Javascript is one of the most famous programming languages right now. Love it or hate it, we must accept that JS became the defacto programming language for the web. The huge JavaScript developer community started creating custom frameworks and libraries to meet the ever-increasing and ever-changing needs of the developers and applications. React.Js is one such library in the sea of JS frameworks and libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0R7AXC6QcW-D20Ct" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>While React.JS came as one of many, it is currently one of the leading frameworks/libraries for UI development currently. This article is a gentle effort to get you introduced to React.</p><h3>Prerequisites</h3><p>Before reading further, one must have the following to be able to make the most out of this article.</p><ul><li>Basic Familiarity of HTML and CSS</li><li>Basic knowledge of JavaScript</li><li>Basic knowledge of ES6 syntax.</li><li>A high-level understanding of DOM</li></ul><p>Here is the codesandbox that hosts the basic react app.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F30flou&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F30flou&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F30flou%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/b00e093bb51691a8662570fa31bb55f4/href">https://medium.com/media/b00e093bb51691a8662570fa31bb55f4/href</a></iframe><p>We will primarily focus on the files public/index.html , src/index.js , src/App.js .</p><p>The public/index.html is the entry point for any react project to render the code created. Here, we can configure site level imports, metadata, SEO tags etc., like any normal website. Along with all these, we MUST include an entry point, call it a &lt;div&gt;, for the compiler to load our react app. In the sandbox, we can clearly see that there is a div with id root that is empty.</p><pre>27. &lt;noscript&gt;</pre><pre>28. You need to enable JavaScript to run this app.</pre><pre>29. &lt;/noscript&gt;</pre><pre>30. <strong>&lt;div id=&quot;root&quot;&gt;&lt;/div&gt;</strong></pre><p>This div will be used to mount the react app we are going to create.</p><p>Now, if we see src/index.js, we notice that we are trying to get a reference to this root div to mount our react component. Using ReactDOM.render() method, our root component(&lt;App /&gt;) is appended into the HTML page, enabling our users to view and user the react app.</p><p>But how does react know that it must use src/index.js file to load our react app? For that, we must look at a different file - package.json . In this file, we have an entry which specifies the app’s entry point.</p><pre>....<br>6. <strong>&#39;main&#39;: &#39;src/index.js&#39;</strong>,<br>....</pre><p>We can modify this file to our needs but a basic react app’s template would already take care of the linking for us. It is this index.js file that acts as a bridge between HTML and React.</p><p>Now, lets shift our focus to src/App.js which hosts our react app’s code. If we closely examine the code in App.js, it looks like HTML written in Javascript function. But it is not. It is called JSX and it is a topic of discussion for another article. Ignoring the fact that it is JSX, the HTML-like code clearly shows what the UI should show and how it should look. Nothing about DOM, dynamic elements creation and no other low-level details are written in this file. React’s compiler takes care of all the nitty-gritties of compiling, optimizing, linking and loading the app into our HTML file through src/index.js.</p><p>In this article, we have seen how a react app works and how it links to HTML with the help of ReactDOM.render() method. This article should give a high-level understanding of React and writing a simple react app.</p><p>We will see how we can use React to modify only a part of our webpage while all the other content can be normal HTML. And how to load completely independent react components into our HTML page.</p><blockquote>Hint: we have already covered that in this article ;)</blockquote><p>If you liked this article, please share it with your network and help me reach more people. Follow me to get more interesting content on React.JS, JS, Flutter, Block-chain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b2204d7731c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React.JS Series: What is JSX? And why do we need it?]]></title>
            <link>https://medium.com/@avnkailash/react-js-series-what-is-jsx-and-why-do-we-need-it-b334fd12704a?source=rss-abcd167c571a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b334fd12704a</guid>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-internal]]></category>
            <dc:creator><![CDATA[Venkata Naga Kailash Anantha]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 04:32:26 GMT</pubDate>
            <atom:updated>2022-02-25T04:32:26.775Z</atom:updated>
            <content:encoded><![CDATA[<p>JSX, otherwise called as JS XML or JavaScript eXtension , is <strong>NOT</strong> HTML, but it definitely uses HTML heavily. Simply put, JSX is a syntactic sugar that aids developers in writing react code in a more intuitive and visually coherent way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I0bW7tdTkQ-pDaIb" /><figcaption>Photo by <a href="https://unsplash.com/@florianolv?utm_source=medium&amp;utm_medium=referral">Florian Olivo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>React has many principles wired into its DNA. Seperation of Concerns and Declarative approach are two among them.</p><p>Before going any further, lets see what does Seperation of Concerns and Declarative Approach mean!</p><ol><li><strong>Seperation of Concerns,</strong> or <strong>SoC, </strong>is a principle of software design that tells us to separate out the code into different components such that each component has one and only one concern (call it responsibility) to take care of.</li><li><strong>Declarative Approach</strong> ensures that the developer has to specify what he/she wants and the how part is taken care by the compiler.</li></ol><p>JSX is a step to achieve these two core principles of React. By using JSX in writing the code, the developers off-load the how part in rendering the code in the UI and at the same time, they are not concerned about the internals of how JSX is converted into a renderable code. The only responsibility of a developer is to design and create react apps. Remaining non-app or generic tasks should not be something they should be bothered about.</p><p>All said, how does JSX actually achieve the principles mentioned above? To understand that, lets dive further and review few code snippets:</p><ol><li><strong>Pure JS Approach:</strong> The following code snippet shows a pure JS based approach in order to add a simple paragraph to a root element in our HTML document.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dee652c02acfb50e44afc8cd2239056f/href">https://medium.com/media/dee652c02acfb50e44afc8cd2239056f/href</a></iframe><p>Before react, a pure JS based node creation required a lot of unnecessary coding to achieve even a small UI.</p><p>2. <strong>Early JSX Approach: </strong>When react first came, it too had a very similar and imperative way of specifying new HTML nodes and UI. Here is a sample code snippet using the early JSX:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/35e178e1853f5d807c882407fe53ad1f/href">https://medium.com/media/35e178e1853f5d807c882407fe53ad1f/href</a></iframe><p>As you can see in the above code snippet, even though we use JSX, the code is still closer to being called an imperative code than a declarative code. Also, there is a lot of repetition in this version of JSX. The developer must call createElement for every new component created, specify the HTML elements in a non-UI fashion which hindered the developer’s capability to easily correlate UI to the actual code. Added to this, debugging is another challenge with this coding style.</p><p>Keeping these challenges in view, the team behind react came up with a new version of JSX, which is more intuitive and close to HTML syntax.</p><p>3. <strong>Modern JSX Approach:</strong> Learning from the mistakes, react team has revamped JSX completely. Even though react uses the early JSX even now to render elements, it became more of a background setup. The responsibility of specifying createElement and coding imperatively has been taken off from the developers. A more intuitive syntax which looks very similar to HTML has been introduced.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5feb481d4ec55f8fd2871a8f4efaa096/href">https://medium.com/media/5feb481d4ec55f8fd2871a8f4efaa096/href</a></iframe><p>The current iteration of JSX is truly declarative and intuitive for the developers. They care only about what should be displayed in the UI and how it should look, but not how it is rendered on the UI or how the HTML nodes/elements are created.</p><p>The above examples show us the advantages a react developer gets when using JSX compared to a vanilla JS based UI implementation. But that is half the answer. Why should JSX tags look so similar to our HTML tags? Why didn&#39;t the JSX developers choose some other tag naming which can be even better than the HTML tags? The reason for this lies in the way modern JSX is converted to HTML code. Now lets see how a JSX element is rendered in the UI.</p><p>This JSX code: &lt;h1&gt;Header Text&lt;/h1&gt; is translated to the following code by a JS compiler</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50c18b19fb62e08c94e3cfbf3bb551d6/href">https://medium.com/media/50c18b19fb62e08c94e3cfbf3bb551d6/href</a></iframe><p>And now, this intermediate code is inturn converted to the actual JS code that would render the h1 element on to the UI. This way, compilers like Babel help developers to focus on the actual task of specifying how the UI should look and leave the rest to the system. And since the translation of modern JSX to HTML code is taken care by the compiler, the base syntax is still similar to HTML.</p><p>In this article, we have seen why JSX is used in developing react apps and why it looks very similar to HTML tags even though it is not actually HTML.</p><p>If you have liked this post, please subscribe to me to get more such content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b334fd12704a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>