最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React - > What do you call the message wrapped in curly braces below? - Stack Overflow

programmeradmin3浏览0评论

could you please help with finding the right answer for the quiz question:

What do you call the message wrapped in curly braces below?

let message = "Hi there"; 
const element = <p>{message}</p>

a. JS function

b. JS element

c. JS expression

d. JSX wrapper

Is the right answer "JSX wrapper" or "JS expression" reference link from the official docs .html

could you please help with finding the right answer for the quiz question:

What do you call the message wrapped in curly braces below?

let message = "Hi there"; 
const element = <p>{message}</p>

a. JS function

b. JS element

c. JS expression

d. JSX wrapper

Is the right answer "JSX wrapper" or "JS expression" reference link from the official docs https://reactjs/docs/introducing-jsx.html

Share Improve this question asked Aug 10, 2020 at 9:01 Evgenii BazhanovEvgenii Bazhanov 9261 gold badge7 silver badges20 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

That's just a JS Expression wrapped in JSX. So, the right answer is c.

You can take reference: JSX is an Expression Too

JSX Wrapper is nothing but JSX Element like we can call wrapper to html element that is root of. So, the JSX wrapper is JS Expression wrapping element. In the example <p /> is what you may call JSX wrapper.

The message wrapped in curly braces below:

let message = "Hi there"; 
const element = <p>{message}</p>

The right answer is: (c.) JS expression

发布评论

评论列表(0)

  1. 暂无评论