<?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: sandeepsamanth</title>
    <description>The latest articles on Forem by sandeepsamanth (@sandeepsamanth).</description>
    <link>https://forem.com/sandeepsamanth</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%2F1005223%2F7155ebf7-50b2-437a-91d6-9b005ca98356.png</url>
      <title>Forem: sandeepsamanth</title>
      <link>https://forem.com/sandeepsamanth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sandeepsamanth"/>
    <language>en</language>
    <item>
      <title>DAY-26-PANDAS</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Sat, 22 Apr 2023 07:49:11 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-26-pandas-818</link>
      <guid>https://forem.com/sandeepsamanth/day-26-pandas-818</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd 
data = {"a":[1,2,3,4],
       "b":[4,5,6,7],
       "c":["sudh" , "krish","hitesh","navin"]}
df= pd.DataFrame(data)
df.set_index('a',inplace=True)
df = df.reset_index()

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data = {"a":[1,2,3,4],
       "b":[4,5,6,7],
       "c":["sudh" , "krish","hitesh","navin"]}
df1 = pd.DataFrame(data,index = ['a','b','c','d'])
df1.reindex(['b','c','d','a'])

for i,j in df1.iterrows():
    print( j)

for col_name , column in df1.iteritems():
    print( col_name , column)

def test(x):
    return x.sum()
df1.apply(test,axis=0)
//a                      10
//b                      22
//c    sudhkrishhiteshnavin

df2 = df1[['a','b']]
df2.applymap(lambda x : x**2)
df.sort_values('c')
df.sort_index(ascending = False)

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Python Pandas - Window Functions
df4 = pd.DataFrame({'a' : [3,4,5,2,1,3,4,5,6]})
df4['a'].rolling(window=1).mean()
df4['a'].rolling(window=3).mean()

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Python Pandas - Date Functionality

date = pd.date_range(start='2023-04-23' , end = '2023-06-23')
df_date = pd.DataFrame({'date':date})
df7 = pd.DataFrame({"date" : ['2023-06-23' , '2023-06-22','2023-06-20']})
df7['updated_date'] = pd.to_datetime(df7['date'])
df7['year'] = df7['updated_date'].dt.year
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Python Pandas –Time Delta
pd.Timedelta(days= 1,hours = 5 ,minutes = 45)
dt = pd.to_datetime('2023-06-20')
td = pd.Timedelta(days = 1 )
dt+td
Timestamp('2023-06-21 00:00:00')

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Python Pandas - Categorical Data

data = ["sudh" , "krish" , "hitesh" , "navin","sudh" ,"sudh" ]
cat = pd.Categorical(data)
cat.value_counts()

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Python Pandas – Visualization
d = pd.Series([1,2,3,3,5,6,6,8])
d
d.plot()
df = pd.DataFrame({'a':[3,4,5,6,7],
                  'b':[4,5,6,7,8]})
df.plot(x= 'a',y='b')
df.plot.scatter(x= 'a',y='b')
d = pd.Series([1,2,3,3,5,6,6,8])
d
d.plot.pie()

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>DAY 25-PANDAS</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Fri, 21 Apr 2023 20:50:05 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-25-pandas-14gj</link>
      <guid>https://forem.com/sandeepsamanth/day-25-pandas-14gj</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd 
df = pd.read_csv("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv")

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;DROP and SET INDEX&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df.drop('PassengerId',axis=1,inplace=True)//permanently drops passengerID
df.drop(3,inplace=True)//drops 3rd row

df.set_index("Name",inplace=True)
df.reset_index()

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

&lt;/div&gt;



&lt;p&gt;`d = {'key1' :[3,4,5,6,7],&lt;br&gt;
     'key2':[5,6,7,8,6],&lt;br&gt;
     'key3':[4,5,6,7,8]&lt;br&gt;
}&lt;br&gt;
pd.DataFrame(d)&lt;br&gt;
df1 = pd.read_csv('taxonomy.csv')&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nnHRvtve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vp3loygu2vw401jc371.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nnHRvtve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vp3loygu2vw401jc371.png" alt="Image description" width="453" height="377"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df1.dropna()
df1.dropna(inplace=True)
df1.dropna(axis=1)
df2.fillna("sudh")
df.reset_index(inplace=True)
g = df.groupby('Survived')
g.sum()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9tGn58kM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/demdyw3ylms0znymlxhi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9tGn58kM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/demdyw3ylms0znymlxhi.png" alt="Image description" width="385" height="141"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;g.mean()
g1 = df.groupby('Pclass')
g1.max().transpose()

//concatinate
df5 = df[['Name',   'Survived', 'Pclass']][0:5]
df6 = df[['Name',   'Survived', 'Pclass']][5:10]
pd.concat([df5,df6])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;MERGE&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data1 = pd.DataFrame({'key1':[1,2,4,5,6],
                      'key2':[4,5,6,7,8],
                      'key3':[3,4,5,6,6]
}
)
data2 = pd.DataFrame({'key1':[1,2,45,6,67],
                      'key4':[56,5,6,7,8],
                      'key5':[3,56,5,6,6]
}
)
pd.merge(data1,data2)
pd.merge(data1,data2,how = 'left')
pd.merge(data1,data2,how = 'right')
pd.merge(data1,data2,how = 'outer',on = 'key1')
pd.merge(data1,data2,how = 'cross')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;similarly to merge we have join&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data1.join(data2,how='right')
data1.join(data2,how='inner')
data1.join(data2,how='outer')
data1.join(data2,how='cross')

df['Fare_INR'] = df['Fare'].apply(lambda x : x*80)
df['name_len'] = df['Name'].apply(len)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Day-05</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Mon, 23 Jan 2023 11:45:06 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-05-b30</link>
      <guid>https://forem.com/sandeepsamanth/day-05-b30</guid>
      <description>&lt;h2&gt;
  
  
  Practicing with building mini projects useState useEffect
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;creating a tabs for different user&lt;/em&gt;&lt;br&gt;
npm i react-icons&lt;/p&gt;

&lt;p&gt;App.js&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, { useState, useEffect } from 'react'
import { FaAngleDoubleRight } from 'react-icons/fa'
// ATTENTION!!!!!!!!!!
// I SWITCHED TO PERMANENT DOMAIN
const url = 'https://course-api.com/react-tabs-project'
function App() {
  const [loading,setLoading]=useState(true)
  const [jobs,setJobs]=useState([])
  const [value,setValue]=useState(1)

  const fetchJobs=async ()=&amp;gt;{
    const response=await fetch(url)
    const newJobs=await response.json()
    setJobs(newJobs)
    setLoading(false)
  }

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

 if(loading){
  return (&amp;lt;section className='section loading'&amp;gt;
  &amp;lt;h1&amp;gt;
  loading...
  &amp;lt;/h1&amp;gt;&amp;lt;/section&amp;gt;)
 }
 const {company,dates,duties,title}=jobs[value]

  return &amp;lt;section className="section"&amp;gt;
            &amp;lt;div className="title"&amp;gt;
              &amp;lt;h2&amp;gt;experience&amp;lt;/h2&amp;gt;
            &amp;lt;div className="underline"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div className="jobs-center"&amp;gt;
             &amp;lt;div className="btn-container"&amp;gt;
             {
               jobs.map((item,index)=&amp;gt;{
                 return &amp;lt;button key={item.id} 
                               className={`job-btn ${index===value&amp;amp;&amp;amp;'active-btn'}`} 
                               onClick={()=&amp;gt;setValue(index)}&amp;gt;
                               {item.company}
                        &amp;lt;/button&amp;gt;

               })
             }
             &amp;lt;/div&amp;gt;

             &amp;lt;article className="job-info"&amp;gt;
             &amp;lt;h3&amp;gt;{title}&amp;lt;/h3&amp;gt;
             &amp;lt;h4&amp;gt;{company}&amp;lt;/h4&amp;gt;
             &amp;lt;p className="job-date"&amp;gt;{dates}&amp;lt;/p&amp;gt;
             {duties.map((duty,index)=&amp;gt;{
               return &amp;lt;div className="job-desc" key={index}&amp;gt;
                          &amp;lt;FaAngleDoubleRight className='job-icon'/&amp;gt;
                          &amp;lt;p&amp;gt;{ duty}&amp;lt;/p&amp;gt;
                      &amp;lt;/div&amp;gt;
             })}
             &amp;lt;/article&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/section&amp;gt;
}

export default App

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

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.App {
  text-align: center;
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .App-logo {
    animation: App-logo-spin infinite 20s linear;
  }
}

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

.App-link {
  color: #61dafb;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fnbrczvgkiry8v1h8x9p1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnbrczvgkiry8v1h8x9p1.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>day 4 react projects with useState useEffect hook</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Sat, 14 Jan 2023 03:20:38 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-4-react-projects-with-usestate-useeffect-hook-3pk3</link>
      <guid>https://forem.com/sandeepsamanth/day-4-react-projects-with-usestate-useeffect-hook-3pk3</guid>
      <description>&lt;h2&gt;
  
  
  project-1
&lt;/h2&gt;

&lt;p&gt;use the previous learning to build a project where it has topics like fetch data and show and hide components and passing of props&lt;/p&gt;

&lt;p&gt;App.js&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, { useState, useEffect } from 'react'
import Loading from './Loading'
import Tours from './Tours'
import './App.css';

// I SWITCHED TO PERMANENT DOMAIN
const url = 'https://course-api.com/react-tours-project'

function App() {
  const [loading,setLoading]=useState(true)
  const [tours,setTours]=useState([])


  const fetchTours=async()=&amp;gt;{
    setLoading(true)
    try{
       const response=await fetch(url);
       const tours=await response.json();
       setLoading(false)
       setTours(tours)
       console.log(tours)
      }catch(error)
      {
        setLoading(false)
        console.log(error)
      }  
  }

   useEffect(()=&amp;gt;{
    fetchTours()
  },[])
    const removeTour=(id)=&amp;gt;{
    const newTours=tours.filter((tour)=&amp;gt; tour.id!==id)
    setTours(newTours)
  }

  if(loading){
    return(
      &amp;lt;main&amp;gt;
        &amp;lt;Loading/&amp;gt;
      &amp;lt;/main&amp;gt;
    )
  }
    if(tours.length===0){
    return(
      &amp;lt;main&amp;gt;
        &amp;lt;div className='title'&amp;gt;
          &amp;lt;h2&amp;gt;no tours left&amp;lt;/h2&amp;gt;
          &amp;lt;button className="btn" onClick={ fetchTours}&amp;gt;refresh&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/main&amp;gt;
    )
  }
  return (
   &amp;lt;main&amp;gt;
        &amp;lt;Tours tours={tours} removeTour={removeTour}/&amp;gt;
    &amp;lt;/main&amp;gt;
  );
}

export default App;

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

&lt;/div&gt;



&lt;p&gt;Tours.js&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 Tour from './Tour';

const Tours = ({tours,removeTour}) =&amp;gt; {
  return (
    &amp;lt;section&amp;gt;
     &amp;lt;div className="title"&amp;gt;
      &amp;lt;h2&amp;gt;our tours&amp;lt;/h2&amp;gt;
      &amp;lt;div className="underline"&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;/div&amp;gt;
     &amp;lt;div&amp;gt;
      {
        tours.map((tour)=&amp;gt;{
            return &amp;lt;Tour key={tour.id}removeTour={removeTour} {...tour}&amp;gt;&amp;lt;/Tour&amp;gt;
        })
      }
     &amp;lt;/div&amp;gt;

    &amp;lt;/section&amp;gt;
  )
}

export default Tours

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

&lt;/div&gt;



&lt;p&gt;tour.js&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  { useState, useEffect } from 'react'

const Tour = ({id,image,info,price,name,removeTour}) =&amp;gt; {
    const [readMore,setReadMore]=useState(false)
  return (
     &amp;lt;article className='single-tour'&amp;gt;
            &amp;lt;img src={image} alt="" /&amp;gt;
            &amp;lt;footer&amp;gt;
              &amp;lt;div className="tour-info"&amp;gt;
                &amp;lt;h4&amp;gt;{name}&amp;lt;/h4&amp;gt;
                &amp;lt;h4 className='tour-price'&amp;gt;${price}&amp;lt;/h4&amp;gt;
              &amp;lt;/div&amp;gt;
              &amp;lt;p&amp;gt;{readMore?info:`${info.substring(0,200)}...`}
              &amp;lt;button onClick={()=&amp;gt;setReadMore(!readMore)}&amp;gt;
                {
                  readMore?'show less':'read more'
                }
              &amp;lt;/button&amp;gt;
              &amp;lt;/p&amp;gt;
              &amp;lt;button className="delete-btn" onClick={()=&amp;gt;removeTour(id)} &amp;gt;not insterested&amp;lt;/button&amp;gt;
            &amp;lt;/footer&amp;gt;
        &amp;lt;/article&amp;gt;
  )
}

export default Tour

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

&lt;/div&gt;



&lt;p&gt;css used&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
=============== 
Variables
===============
*/

:root {
  /* dark shades of primary color*/
  --clr-primary-1: hsl(205, 86%, 17%);
  --clr-primary-2: hsl(205, 77%, 27%);
  --clr-primary-3: hsl(205, 72%, 37%);
  --clr-primary-4: hsl(205, 63%, 48%);
  /* primary/main color */
  --clr-primary-5: hsl(205, 78%, 60%);
  /* lighter shades of primary color */
  --clr-primary-6: hsl(205, 89%, 70%);
  --clr-primary-7: hsl(205, 90%, 76%);
  --clr-primary-8: hsl(205, 86%, 81%);
  --clr-primary-9: hsl(205, 90%, 88%);
  --clr-primary-10: hsl(205, 100%, 96%);
  /* darkest grey - used for headings */
  --clr-grey-1: hsl(209, 61%, 16%);
  --clr-grey-2: hsl(211, 39%, 23%);
  --clr-grey-3: hsl(209, 34%, 30%);
  --clr-grey-4: hsl(209, 28%, 39%);
  /* grey used for paragraphs */
  --clr-grey-5: hsl(210, 22%, 49%);
  --clr-grey-6: hsl(209, 23%, 60%);
  --clr-grey-7: hsl(211, 27%, 70%);
  --clr-grey-8: hsl(210, 31%, 80%);
  --clr-grey-9: hsl(212, 33%, 89%);
  --clr-grey-10: hsl(210, 36%, 96%);
  --clr-white: #fff;
  --clr-red-dark: hsl(360, 67%, 44%);
  --clr-red-light: hsl(360, 71%, 66%);
  --clr-green-dark: hsl(125, 67%, 44%);
  --clr-green-light: hsl(125, 71%, 66%);
  --clr-black: #222;
  --transition: all 0.3s linear;
  --spacing: 0.1rem;
  --radius: 0.25rem;
  --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  --max-width: 1170px;
  --fixed-width: 620px;
}

/*
=============== 
Global Styles
===============
*/

*,
::after,
::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: var(--clr-grey-10);
  color: var(--clr-grey-1);
  line-height: 1.5;
  font-size: 0.875rem;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  letter-spacing: var(--spacing);
  text-transform: capitalize;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 0.875rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--clr-grey-5);
}

@media screen and (min-width: 800px) {
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  h4 {
    font-size: 1rem;
  }

  body {
    font-size: 1rem;
  }

  h1,
  h2,
  h3,
  h4 {
    line-height: 1;
  }
}

/*  global classes */

/* section */
.section {
  width: 90vw;
  margin: 0 auto;
  max-width: var(--max-width);
}

@media screen and (min-width: 992px) {
  .section {
    width: 95vw;
  }
}

.btn {
  background: var(--clr-primary-5);
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  text-transform: capitalize;
  color: var(--clr-white);
  letter-spacing: var(--spacing);
  border-color: transparent;
  cursor: pointer;
  margin-top: 2rem;
  font-size: 1.2rem;
}

/*
=============== 
Tours
===============
*/
main {
  width: 90vw;
  max-width: var(--fixed-width);
  margin: 5rem auto;
}

.loading {
  text-align: center;
}

.title {
  text-align: center;
  margin-bottom: 4rem;
}

.underline {
  width: 6rem;
  height: 0.25rem;
  background: var(--clr-primary-5);
  margin-left: auto;
  margin-right: auto;
}

.single-tour {
  background: var(--clr-white);
  border-radius: var(--radius);
  margin: 2rem 0;
  box-shadow: var(--light-shadow);
  transition: var(--transition);
}

.single-tour:hover {
  box-shadow: var(--dark-shadow);
}

.single-tour img {
  width: 100%;
  height: 20rem;
  object-fit: cover;
  border-top-right-radius: var(--radius);
  border-top-left-radius: var(--radius);
}

.tour-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.tour-info h4 {
  margin-bottom: 0;
}

.single-tour button {
  background: transparent;
  border-color: transparent;
  text-transform: capitalize;
  color: var(--clr-primary-5);
  font-size: 1rem;
  cursor: pointer;
  padding-left: 0.25rem;
}

.tour-price {
  color: var(--clr-primary-5);
  background: var(--clr-primary-10);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}

.single-tour footer {
  padding: 1.5rem 2rem;
}

.single-tour .delete-btn {
  display: block;
  width: 200px;
  margin: 1rem auto 0 auto;
  color: var(--clr-red-dark);
  letter-spacing: var(--spacing);
  background: transparent;
  border: 1px solid var(--clr-red-dark);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3UrFKoXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tz0y13z8gib1bp4bu1ph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3UrFKoXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tz0y13z8gib1bp4bu1ph.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>day 4 reactjs</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Fri, 13 Jan 2023 13:33:50 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-4-reactjs-258d</link>
      <guid>https://forem.com/sandeepsamanth/day-4-reactjs-258d</guid>
      <description>&lt;h2&gt;
  
  
  short circuit operator
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';
// short-circuit evaluation
// ternary operator

const ShortCircuit = () =&amp;gt; {
  const [text, setText] = useState('');
  const [isError, setIsError] = useState(false);
  // const firstValue = text || 'hello world';
  // const secondValue = text &amp;amp;&amp;amp; 'hello world';

  return (
    &amp;lt;&amp;gt;
      {/* &amp;lt;h1&amp;gt;{firstValue}&amp;lt;/h1&amp;gt;
      &amp;lt;h1&amp;gt;value : {secondValue}&amp;lt;/h1&amp;gt; */}
      {/* {if(){console.log('hello world')}} */}
      &amp;lt;h1&amp;gt;{text || 'john doe'}&amp;lt;/h1&amp;gt;
      &amp;lt;button className='btn' onClick={() =&amp;gt; setIsError(!isError)}&amp;gt;
        toggle error
      &amp;lt;/button&amp;gt;
      {isError &amp;amp;&amp;amp; &amp;lt;h1&amp;gt;Error...&amp;lt;/h1&amp;gt;}
      {isError ? (
        &amp;lt;p&amp;gt;there is an error...&amp;lt;/p&amp;gt;
      ) : (
        &amp;lt;div&amp;gt;
          &amp;lt;h2&amp;gt;there is no error&amp;lt;/h2&amp;gt;
        &amp;lt;/div&amp;gt;
      )}
    &amp;lt;/&amp;gt;
  );
};

export default ShortCircuit;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ternary oprator with show and hide component
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState, useEffect } from 'react';

const ShowHide = () =&amp;gt; {
  const [show, setShow] = useState(false);
  return (
    &amp;lt;&amp;gt;
      &amp;lt;button className='btn' onClick={() =&amp;gt; setShow(!show)}&amp;gt;
        show/hide
      &amp;lt;/button&amp;gt;
      {show &amp;amp;&amp;amp; &amp;lt;Item /&amp;gt;}
    &amp;lt;/&amp;gt;
  );
};

const Item = () =&amp;gt; {
  const [size, setSize] = useState(window.innerWidth);
  const checkSize = () =&amp;gt; {
    setSize(window.innerWidth);
  };
  useEffect(() =&amp;gt; {
    window.addEventListener('resize', checkSize);
    return () =&amp;gt; {
      window.removeEventListener('resize', checkSize);
    };
  }, []);

  return (
    &amp;lt;div style={{ marginTop: '2rem' }}&amp;gt;
      &amp;lt;h1&amp;gt;Window&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;size : {size}&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ShowHide;

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

&lt;/div&gt;



</description>
      <category>discuss</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>day-3</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Fri, 13 Jan 2023 11:47:13 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-3-2m7n</link>
      <guid>https://forem.com/sandeepsamanth/day-3-2m7n</guid>
      <description>&lt;p&gt;UseEffect fetch data and destructuring&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, { useState, useEffect } from 'react';

const url = 'https://api.github.com/users';

const UseEffectFetchData = () =&amp;gt; {

  const [users, setUsers] = useState([]);

  const getUsers=async()=&amp;gt;{
    const response=await fetch(url);
    const users=await response.json();
     setUsers(users);
    console.log(users);
  }

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

  return (
  &amp;lt;&amp;gt;
    &amp;lt;h3&amp;gt;github users&amp;lt;/h3&amp;gt;
    &amp;lt;ul className='users'&amp;gt;
    {
      users.map((user)=&amp;gt;{
        const {id,login,avatar_url,html_url}=user;
        return(
          &amp;lt;li key='id'&amp;gt;
           &amp;lt;img src={avatar_url} alt={login}/&amp;gt;
           &amp;lt;div&amp;gt;
            &amp;lt;h4&amp;gt;{login}&amp;lt;/h4&amp;gt;
            &amp;lt;a href={html_url}&amp;gt;profile&amp;lt;/a&amp;gt;
           &amp;lt;/div&amp;gt;
          &amp;lt;/li&amp;gt;
        )
      })
    }
    &amp;lt;/ul&amp;gt;
  &amp;lt;/&amp;gt;
  )
};

export default UseEffectFetchData;

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>day-2-react js</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Wed, 11 Jan 2023 17:57:44 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/day-2-react-js-4dl8</link>
      <guid>https://forem.com/sandeepsamanth/day-2-react-js-4dl8</guid>
      <description>&lt;p&gt;DATA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const data = [
  { id: 1, name: 'john' },
  { id: 2, name: 'peter' },
  { id: 3, name: 'susan' },
  { id: 4, name: 'anna' },
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;USE STATE&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;// starts with use&lt;/li&gt;
&lt;li&gt;// component must be uppercase&lt;/li&gt;
&lt;li&gt;// invoke inside function/component body&lt;/li&gt;
&lt;li&gt;// don't call hooks conditonally_
&lt;/li&gt;
&lt;/ul&gt;

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

const UseStateBasics = () =&amp;gt; {
  // console.log(useState());
  // const value = useState()[0];
  // const handler = useState()[1];
  // console.log(value, handler);

  const [text, setText] = useState('random title');
  const handleClick = () =&amp;gt; {
    if (text === 'random title') {
      setText('hello world');
    } else {
      setText('random title');
    }
  };

  return (
    &amp;lt;React.Fragment&amp;gt;
      &amp;lt;h1&amp;gt;{text}&amp;lt;/h1&amp;gt;
      &amp;lt;button type='button' className='btn' onClick={handleClick}&amp;gt;
        change title
      &amp;lt;/button&amp;gt;
    &amp;lt;/React.Fragment&amp;gt;
  );
};

export default UseStateBasics;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-useState array&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 { data } from '../../../data';
const UseStateArray = () =&amp;gt; {
  const [people, setPeople] = React.useState(data);

  const removeItem = (id) =&amp;gt; {
    let newPeople = people.filter((person) =&amp;gt; person.id !== id);
    setPeople(newPeople);
  };
  return (
    &amp;lt;&amp;gt;
      {people.map((person) =&amp;gt; {
        const { id, name } = person;
        return (
          &amp;lt;div key={id} className='item'&amp;gt;
            &amp;lt;h4&amp;gt;{name}&amp;lt;/h4&amp;gt;
            &amp;lt;button onClick={() =&amp;gt; removeItem(id)}&amp;gt;remove&amp;lt;/button&amp;gt;
          &amp;lt;/div&amp;gt;
        );
      })}
      &amp;lt;button className='btn' onClick={() =&amp;gt; setPeople([])}&amp;gt;
        clear items
      &amp;lt;/button&amp;gt;
    &amp;lt;/&amp;gt;
  );
};

export default UseStateArray;

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

&lt;/div&gt;



&lt;p&gt;-useState object&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, { useState } from 'react';

const UseStateObject = () =&amp;gt; {
  const [person, setPerson] = useState({
    name: 'peter',
    age: 24,
    message: 'random message',
  });

  // const [name,setName] = useState('peter')
  // const [age,setAge] = useState(24)
  // const [message,setMessage] = useState('random message')

  const changeMessage = () =&amp;gt; {
    setPerson({ ...person, message: 'hello world' });
    // setMessage('hello world')
  };

  return (
    &amp;lt;&amp;gt;
      &amp;lt;h3&amp;gt;{person.name}&amp;lt;/h3&amp;gt;
      &amp;lt;h3&amp;gt;{person.age}&amp;lt;/h3&amp;gt;
      &amp;lt;h4&amp;gt;{person.message}&amp;lt;/h4&amp;gt;
      &amp;lt;button className='btn' onClick={changeMessage}&amp;gt;
        change message
      &amp;lt;/button&amp;gt;
    &amp;lt;/&amp;gt;
  );
};

export default UseStateObject;

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

&lt;/div&gt;



&lt;p&gt;-useState counter&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, { useState } from 'react';

const UseStateCounter = () =&amp;gt; {
  const [value, setValue] = useState(0);

  const reset = () =&amp;gt; {
    setValue(0);
  };

  const complexIncrease = () =&amp;gt; {
    setTimeout(() =&amp;gt; {
      // setValue(value + 1);
      setValue((prevState) =&amp;gt; {
        return prevState + 1;
      });
    }, 2000);
  };

  return (
    &amp;lt;&amp;gt;
      &amp;lt;section style={{ margin: '4rem 0' }}&amp;gt;
        &amp;lt;h2&amp;gt;regular counter&amp;lt;/h2&amp;gt;
        &amp;lt;h1&amp;gt;{value}&amp;lt;/h1&amp;gt;
        &amp;lt;button className='btn' onClick={() =&amp;gt; setValue(value - 1)}&amp;gt;
          decrease
        &amp;lt;/button&amp;gt;
        &amp;lt;button className='btn' onClick={reset}&amp;gt;
          reset
        &amp;lt;/button&amp;gt;
        &amp;lt;button className='btn' onClick={() =&amp;gt; setValue(value + 1)}&amp;gt;
          increase
        &amp;lt;/button&amp;gt;
      &amp;lt;/section&amp;gt;
      &amp;lt;section style={{ margin: '4rem 0' }}&amp;gt;
        &amp;lt;h2&amp;gt;more complex counter&amp;lt;/h2&amp;gt;
        &amp;lt;h1&amp;gt;{value}&amp;lt;/h1&amp;gt;
        &amp;lt;button className='btn' onClick={complexIncrease}&amp;gt;
          increase later
        &amp;lt;/button&amp;gt;
      &amp;lt;/section&amp;gt;
    &amp;lt;/&amp;gt;
  );
};

export default UseStateCounter;

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

&lt;/div&gt;



</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Events in react</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Tue, 10 Jan 2023 12:09:17 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/events-in-react-1dhg</link>
      <guid>https://forem.com/sandeepsamanth/events-in-react-1dhg</guid>
      <description>&lt;p&gt;Events - Fundamentals&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vanilla JS
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const btn = document.getElementById('btn');

btn.addEventListener('click', function (e) {
  // access event object
  // do something when event fires
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;similar approach&lt;/li&gt;
&lt;li&gt;element, event, function&lt;/li&gt;
&lt;li&gt;again camelCase
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const EventExamples = () =&amp;gt; {
  const handleButtonClick = () =&amp;gt; {
    alert('handle button click');
  };
  return (
    &amp;lt;section&amp;gt;
      &amp;lt;button onClick={handleButtonClick}&amp;gt;click me&amp;lt;/button&amp;gt;
    &amp;lt;/section&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;most common&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;onClick (click events)&lt;/li&gt;
&lt;li&gt;onSubmit (submit form )&lt;/li&gt;
&lt;li&gt;onChange (input change )
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function BookList() {
  return (
    &amp;lt;section className='booklist'&amp;gt;
      &amp;lt;EventExamples /&amp;gt;
      {books.map((book) =&amp;gt; {
        return &amp;lt;Book {...book} key={book.id} /&amp;gt;;
      })}
    &amp;lt;/section&amp;gt;
  );
}

const EventExamples = () =&amp;gt; {
  const handleFormInput = () =&amp;gt; {
    console.log('handle form input');
  };
  const handleButtonClick = () =&amp;gt; {
    alert('handle button click');
  };
  return (
    &amp;lt;section&amp;gt;
      &amp;lt;form&amp;gt;
        &amp;lt;h2&amp;gt;Typical Form&amp;lt;/h2&amp;gt;
        &amp;lt;input
          type='text'
          name='example'
          onChange={handleFormInput}
          style={{ margin: '1rem 0' }}
        /&amp;gt;
      &amp;lt;/form&amp;gt;
      &amp;lt;button onClick={handleButtonClick}&amp;gt;click me&amp;lt;/button&amp;gt;
    &amp;lt;/section&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Event Object and Form Submission&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const EventExamples = () =&amp;gt; {
  return (
    &amp;lt;section&amp;gt;
      &amp;lt;form&amp;gt;
        &amp;lt;h2&amp;gt;Typical Form&amp;lt;/h2&amp;gt;
        &amp;lt;input
          type='text'
          name='example'
          onChange={(e) =&amp;gt; console.log(e.target.value)}
          style={{ margin: '1rem 0' }}
        /&amp;gt;
      &amp;lt;/form&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; console.log('you clicked me')}&amp;gt;click me&amp;lt;/button&amp;gt;
    &amp;lt;/section&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>map ,filter,......</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Tue, 10 Jan 2023 10:27:13 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/map-filter-5geo</link>
      <guid>https://forem.com/sandeepsamanth/map-filter-5geo</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const names = ['john', 'peter', 'susan'];
const newNames = names.map((name) =&amp;gt; {
  console.log(name);
  return &amp;lt;h1&amp;gt;{name}&amp;lt;/h1&amp;gt;;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>props-destructuring</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Tue, 10 Jan 2023 10:01:59 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/props-destructuring-eij</link>
      <guid>https://forem.com/sandeepsamanth/props-destructuring-eij</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const someObject = {
  name: 'john',
  job: 'developer',
  location: 'florida',
};

console.log(someObject.name);
const { name, job } = someObject;
console.log(job);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;other ex&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Book = (props) =&amp;gt; {
  const { img, title, author } = props;
  return (
    &amp;lt;article className='book'&amp;gt;
      &amp;lt;img src={img} alt={title} /&amp;gt;
      &amp;lt;h2&amp;gt;{title}&amp;lt;/h2&amp;gt;
      &amp;lt;h4&amp;gt;{author} &amp;lt;/h4&amp;gt;
    &amp;lt;/article&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Book = ({ img, title, author }) =&amp;gt; {
  return (
    &amp;lt;article className='book'&amp;gt;
      &amp;lt;img src={img} alt={title} /&amp;gt;
      &amp;lt;h2&amp;gt;{title}&amp;lt;/h2&amp;gt;
      &amp;lt;h4&amp;gt;{author} &amp;lt;/h4&amp;gt;
    &amp;lt;/article&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>discuss</category>
      <category>ai</category>
    </item>
    <item>
      <title>react day 1 jsx-rules</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Tue, 10 Jan 2023 09:49:51 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/react-day-1-jsx-rules-4mcl</link>
      <guid>https://forem.com/sandeepsamanth/react-day-1-jsx-rules-4mcl</guid>
      <description>&lt;p&gt;return single element (one parent element)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;semantics section/article&lt;/li&gt;
&lt;li&gt;Fragment - let's us group elements without adding extra nodes &lt;/li&gt;
&lt;li&gt;camelCase property naming convention
&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;button onClick={myFunction}&amp;gt;click me&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;className instead of class
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return &amp;lt;div className='someValue'&amp;gt;hello&amp;lt;/div&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;








&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ReactDOM from 'react-dom/client';

function BookList() {
  return (
    &amp;lt;section&amp;gt;
      &amp;lt;Book /&amp;gt;
      &amp;lt;Book /&amp;gt;
      &amp;lt;Book /&amp;gt;
      &amp;lt;Book /&amp;gt;
    &amp;lt;/section&amp;gt;
  );
}

const Book = () =&amp;gt; {
  return (
    &amp;lt;article className='book'&amp;gt;
      &amp;lt;Image /&amp;gt;
      &amp;lt;Title /&amp;gt;
      &amp;lt;Author /&amp;gt;
    &amp;lt;/article&amp;gt;
  );
};

const Image = () =&amp;gt; (
  &amp;lt;img
    src='https://images-na.ssl-images-amazon.com/images/I/71m+Qtq+HrL._AC_UL900_SR900,600_.jpg'
    alt='Interesting Facts For Curious Minds'
  /&amp;gt;
);
const Title = () =&amp;gt; {
  return &amp;lt;h2&amp;gt;Interesting Facts For Curious Minds&amp;lt;/h2&amp;gt;;
};
const Author = () =&amp;gt; &amp;lt;h4&amp;gt;Jordan Moore &amp;lt;/h4&amp;gt;;

const root = ReactDOM.createRoot(document.getElementById('root'));

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

&lt;/div&gt;



</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>react</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>react day 1</title>
      <dc:creator>sandeepsamanth</dc:creator>
      <pubDate>Tue, 10 Jan 2023 09:36:39 +0000</pubDate>
      <link>https://forem.com/sandeepsamanth/react-day-1-1j2a</link>
      <guid>https://forem.com/sandeepsamanth/react-day-1-1j2a</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Greeting() {
  return &amp;lt;h2&amp;gt;My First Component&amp;lt;/h2&amp;gt;;
}

// arrow function also works
const Greeting = () =&amp;gt; {
  return &amp;lt;h2&amp;gt;My First Component&amp;lt;/h2&amp;gt;;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;starts with capital letter&lt;br&gt;
must return JSX (html)&lt;br&gt;
always close tag&lt;/p&gt;




</description>
      <category>rust</category>
      <category>coding</category>
      <category>learning</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
