REACT

[React] 객체 생성 및 객체 호출

yangjoy 2021. 8. 16. 17:52

객체 생성

const textInfo = "Hello"
const textInfo = {
    text1 = "WE PROVIDE",
    text2 = "VISUAL CODING",
    text3 = "SOLUTIONS",
    text4 = "FOR YOU WEBS"
}

 

객체 호출

function Main(){
    return(
        <div id="wrap">
            <Header/>
            <section id="mainCont">
                <Info
                    text1 = {textInfo.text1}
                    text2 = {textInfo.text2}
                    text3 = {textInfo.text3}
                    text4 = {textInfo.text4}
                />
            </section>
            <Footer/>

        </div>
    )
}

'REACT' 카테고리의 다른 글

[React] 클래스형 컴포넌트  (0) 2021.08.16
[React] map  (0) 2021.08.16
[React] props  (0) 2021.08.16
[React] 객체화 시키기 - Component  (0) 2021.08.16
[React] 제목을 누를 때 각각 다른 UI가 나오도록 하기.  (0) 2021.07.22