[리액트] 중괄호는 언제 사용하나요
728x90
For instance, because JSX is a syntactic extension of JavaScript, you can actually write JavaScript directly within JSX. To do this, you simply include the code you want to be treated as JavaScript within curly braces: { 'this is treated as JavaScript code' }. Keep this in mind, since it's used in several future challenges.

출처: freecodecamp.org

JSX는 JavaScript + HTML이다.

JSX에서 자바스크립트 코드는 {} (curly braces)로 묶으면 된다.

리액트하면서 언제 무슨 괄호를 써야할지부터 막막했다..

그리고 드디어 뜻을 알아냈다... ㅠㅠ

 

320x100