我的代码react出了什么问题
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' 可能只出现在顶层
谁能帮我?