<?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: Akshan</title>
    <description>The latest articles on DEV Community by Akshan (@akshanvic).</description>
    <link>https://dev.to/akshanvic</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%2F420371%2F977cba45-4534-4967-9ed9-06c2afcaf5a5.png</url>
      <title>DEV Community: Akshan</title>
      <link>https://dev.to/akshanvic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akshanvic"/>
    <language>en</language>
    <item>
      <title>Transition Effect in React JS without any package</title>
      <dc:creator>Akshan</dc:creator>
      <pubDate>Thu, 01 Dec 2022 08:30:30 +0000</pubDate>
      <link>https://dev.to/akshanvic/transition-effect-in-react-js-without-any-package-32mb</link>
      <guid>https://dev.to/akshanvic/transition-effect-in-react-js-without-any-package-32mb</guid>
      <description>&lt;p&gt;Hola Amigo!&lt;/p&gt;

&lt;p&gt;I have searched for applying transition effect when a component renders in the application. Unlike Js Css transition is not working on the react. So when I searched for applying the transition effect, I did not get a satisfactory result (React transition group felt hard for me). So I planned to apply the transition effects without any packages and I succeeded in it.&lt;/p&gt;

&lt;p&gt;here is the Code&lt;/p&gt;

&lt;p&gt;Transition.jsx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {useState,UseEffect} from 'react';
import ".\transtion.css"

export default function TransitionContainer (){
const [transition,setTransition]=useState(false);

useEffect(()=&amp;gt;{
 setTransition(true)
},[])

return(
&amp;lt;div className={`animate ${transition?'displayIt':'noDisplay'}`}&amp;gt;
 /* content here */
&amp;lt;/div&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in css we have to add the code given &lt;/p&gt;

&lt;p&gt;transition.css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.animate{
   transition: 0.5s ease-in;
}

.displayIt{
   opacity:1;
}
.noDisplay{
   opacity:0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can achieve the transition effect when a screen renders using useState and useEffect.&lt;/p&gt;

&lt;p&gt;(Note: this is my first post so if anything feels odd....please comment so that I can rectify it)&lt;/p&gt;

&lt;p&gt;Adios Amigo!!!!&lt;/p&gt;

</description>
      <category>react</category>
      <category>css</category>
      <category>csstransition</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
