import React , {Component} from 'react';
import './App.css'

class App extends Component{
  render(){

    const style = {
      backgroundColor : 'gray',
      border:'1px solid black',
      height:Math.random(Math.random() * 500 ) + 50,
      width:Math.random(Math.random() * 500) + 50,
      WebkitTransition:'all',
      MozTransition:'all',
      msTransition:'all'
    };


    return(
      <div className="my-div"> 
      {/*요소 밖에서는 이렇게 주석 */}
        <h1>리액트 테스트</h1>
        <div style={style}
        // self-cloed 태그에서만 작동하는 주석
        />
        //이렇게는 주석이 되지않음.
        /*이것도 안됨*/
      </div>
    )
  }
}

export default App;

/> 안에 들어가야하며 새줄에 // 방식으로 주석을 사용할수있고. 그렇지 않을경우는

{/* 이런식으로 사용한다 */ }

화면에 보이는 모습

'프로그래밍언어 > React' 카테고리의 다른 글

React Event 이벤트 종류  (0) 2019.07.20
React Component 불러오기 (props)  (0) 2019.07.20
React css사용방법  (0) 2019.07.20
React if문  (0) 2019.07.20
React App.js  (0) 2019.07.20

+ Recent posts