stylesheet access elements using class object name code example

Example 1: javascript create element with class

Let suppose we are creating a div using javascript create element
// create a new div element 
	var newDiv = document.createElement("div"); 
// assigning class name to the new div
	newDiv.className = "className";

Example 2: how to access array datat in class component react

import React, { Component } from 'react'
import './TourList.scss';
import Tour  from '../Tour/Tour';
import { tourData } from './tourData'; //impoert array of data
export default class TourList extends Component {
    state={
        tours:tourData // store array of data in state
    }
    render() {
        const {tours}=this.state // store  state in variable
        

        return (
            <section className="toulist">
            {tours.map(tour=>{ // using map method to destructure
                return <Tour key={tour.id} tour={tour} />; //pass as props
            })}
            
            </section>
        )
    }
}
//----------------------------------------------------
 //how to access props in class component
   const {id,city}=this.props.tour//props