일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- this 객체
- Props
- frontendstudy
- Frontend Study
- 이벤트
- CSS
- try.. catch
- 배열
- HTML
- 메소드 실행
- callback함수
- webProject
- 비동기함수
- REACT
- 함수 실행
- promise
- 이벤트핸들링
- FrontendStydy
- addEventListener
- 렌더링
- DOM
- 자바스크립트
- 컴포넌트
- input
- 배열메소드
- typeScript
- JavaScript
- useRef
- 리액트
- useState
- Today
- Total
목록Props (2)
이다닷
props App.js import React from 'react'; import Hello from './qoffhvjxm/Hello'; import Wrapper from './qoffhvjxm/Wrapper'; function App() { return ( ); } export default App; Hello.js import React from 'react'; function Hello({ color, name, isSpecial }) { return ( { isSpecial ? * : null } 안녕하세요 {name} ); } Hello.defaultProps = { name: '이름없음' } export default Hello; Wrapper.js import React from 're..
props 이용법 {this.props.값의 이름} ex) {this.props.name} 결과 코드 import React, { Component } from 'react'; import './App.css'; class Subject extends Component { render() { return ( {this.props.title} {this.props.sub} ); } } class TOC extends Component { render() { return ( HTML CSS Javascript ); } } class Content extends Component { render() { return ( {this.props.title} {this.props.desc} ); } } class A..