다음 ES6 구문을 이해하는 데 어려움이 있습니다. 나는 워드 프로세서에게 꽤 읽고 더 이상의 변화는 여기에서 일어나고있다처럼 보인다 :ES6 괄호없는 화살표 기능
const renderInput = function renderInput(props) {
return <div>
<label>{props.placeholder}</label>
</div>
}
:
const renderInput = props =>
<div>
<label>{props.placeholder}</label>
</div>
위는 동등겠습니까?
ES6이 아닙니다. JSX 일 수 있습니다. – Quentin
예, HTML을 백틱으로 묶어야합니다. 그리고 문자열 매개 변수는 앞에'$'가 필요합니다 ... $ {param}' – Mottie
@Mottie 예 그것은 동일합니까? – softcode