P粉3582815742023-08-18 09:40:32
元件名稱必須以大寫字母
開頭。將檔案名稱addMore.jsx
重新命名為AddMore.jsx
,並且也要變更匯入路徑。查看此資訊請造訪React.dev功能元件
// ShoppingCardItem.jsx import React from 'react' import { MdDeleteForever } from 'react-icons/md' import AddMorefrom '../AddMore/AddMore' import './ShoppingCardItem.css' export default function ShoppingCardItem() { return ( <div className='shoppingCardItem-Container'> <img src="./img/Apfel.jpg" alt="" /> <p>2x Apfel</p> <AddMore/> <MdDeleteForever /> </div> ) }
// AddMore.jsx import React from 'react' export default function AddMore() { return ( <div className="btn-group"> <button type="button" className="btn btn-primary">+</button> <button type="button" className="btn btn-primary">-</button> </div> ) }