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
相關文章
相關標籤/搜索