ReactJS “导入”和“导出”可能只出现在顶层,这是怎么回事?

2024-04-09

我的代码反应出了什么问题

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>
   )  
}

错误调用此:

“导入”和“导出”可能只出现在顶层

谁能帮我?


当您在反应代码中错过右括号时,您通常会收到此错误。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ReactJS “导入”和“导出”可能只出现在顶层,这是怎么回事? 的相关文章

随机推荐