やりたいこと
- エラーの原因を知りたい
試したこと
下のコードでエラーが出てしまいました。
▼React.js
React.js
1render() { 2 const textList = ['This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card', 'This is a card']; 3 const renderitem = (text) => ( 4 <div> 5 <img src="http://placehold.jp/150x150.png"/> 6 <p>{text}</p> 7 </div> 8 ); 9 return ( 10 <div> 11 {...textList.map(renderitem)} 12 </div> 13 ); 14 }
エラーの内容はこちらです。
▼コンソール
bundle.js:27599 Uncaught Error: Module parse failed: /home/hfukatani/hive/frontend/node_modules/babel-loader/lib/index.js??ref--0!/home/hfukatani/hive/frontend/src/Frontend/javascripts/styleguide/Items.jsx Unexpected token (53:9) You may need an appropriate loader to handle this file type. | 'div', | null, | {...textList.map(renderitem)} | ); | }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/22 10:50