[英]{ React jsx babel es6 webpack } How Can I Comment in render ( return ( // || /**/ ) )?
我上周開始了一個項目。 在回到我的團隊之前,我想評論我的代碼。
/* Just for the Syntax outlook */ class Foo extends React.Components { constructor(props) { super(props); } render() { return ( <div className='bar'> /* <p> cannot commit!!!! </p> ** Following will throw error when bundled with webpack */ // This throws error as well. <div> ) } }
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
代碼可能看起來像評論工作,但目前的JSbin設置沒有在ES6上設置。 當您使用jsx通過webpack運行捆綁它時會拋出錯誤。
以下是以下堆棧
順便說一句,因為Node v6已經出局了,我們還需要使用babel嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.