我的代码有什么问题
export const BeritaView = ({ match }) => {
const article = articles.find(item => item.id === match.params.id);
console.log(articles, match.params.id);
return(
<div>
<h3> News ID: {match.params.id} </h3>
<h4> {article.title} </h4>
<p> {article.content} </p>
<Link to={`/berita`}> Back to Berita dan Kegiatan </Link>
</div>
)
}
错误调用这个:
‘import’ 和 ‘export’ 可能只出现在顶层
谁能帮我?
原文由 user10293819 发布,翻译遵循 CC BY-SA 4.0 许可协议
当你在你的反应代码中错过一个右括号时,你会得到这个错误。