<?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: Krishna Haranath </title>
    <description>The latest articles on DEV Community by Krishna Haranath  (@iamharnad).</description>
    <link>https://dev.to/iamharnad</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%2F299918%2Fbd20bc22-50a4-49c1-96d1-672f136803d0.jpeg</url>
      <title>DEV Community: Krishna Haranath </title>
      <link>https://dev.to/iamharnad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iamharnad"/>
    <language>en</language>
    <item>
      <title>Adding &lt;title&gt; tag to React v18.0 using react-helmet</title>
      <dc:creator>Krishna Haranath </dc:creator>
      <pubDate>Thu, 24 Aug 2023 06:52:36 +0000</pubDate>
      <link>https://dev.to/iamharnad/adding-tag-to-react-v180-using-react-helmet-12n0</link>
      <guid>https://dev.to/iamharnad/adding-tag-to-react-v180-using-react-helmet-12n0</guid>
      <description>&lt;p&gt;There are certain ways you can include title tag to your react component or page. One is using React Helmet and one with UseEffect Hook. &lt;/p&gt;

&lt;p&gt;Although React is frequently praised for enhancing the efficiency of front-end development, it can pose challenges for search engines.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;What is React Helmet?&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
This adaptable React component will oversee any alterations to the document head.&lt;/p&gt;

&lt;p&gt;Helmet utilizes basic HTML tags as input and produces straightforward HTML tags as output. It's extremely straightforward and suitable for React beginners.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;How to use?&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;code&gt;npm i react-helmet&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nfl/react-helmet#readme" rel="noopener noreferrer"&gt;github repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;sample code:&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import {Helmet} from "react-helmet";

class Application extends React.Component {
  render () {
    return (
        &amp;lt;div className="application"&amp;gt;
            &amp;lt;Helmet&amp;gt;
                &amp;lt;meta charSet="utf-8" /&amp;gt;
                &amp;lt;title&amp;gt;My Title&amp;lt;/title&amp;gt;
                &amp;lt;link rel="canonical" href="http://mysite.com/example" /&amp;gt;
            &amp;lt;/Helmet&amp;gt;
            ...
        &amp;lt;/div&amp;gt;
    );
  }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.npmjs.com/package/react-helmet" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is essential for setting metadata, such as titles, descriptions, and other meta tags, which are crucial for SEO and improving a website's search engine visibility.&lt;/p&gt;

&lt;p&gt;If you're looking to enhance your React application's SEO capabilities and optimize the content in the head section, React Helmet is generally recommended as a dependable solution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you 🫡&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>helmet</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
