JSX 中的 If-Else

JSX 中的 If-Else 你无法在JSX中使用 if-else 语句,由于 JSX 只是函数调用和对象建立的语法糖。看下面这个例子:函数 // This JSX: React.render(<div id="msg">Hello World!</div>, mountNode); // Is transformed to this JS: React.render(React.createE
相关文章
相关标签/搜索