小编Tei*_*eah的帖子

如果在反应中满足条件,如何将 const 变量重新分配为 true

如果反应中满足条件,如何将 const 重新分配为 true?它不断显示错误“displayInternalForm”已声明,但其值从未被读取

export async function getStaticProps({ params }) {

  const displayInternalForm = false;

  const internalJob = internalcategory.categories.find((cat) => 
                      cat.id?.includes("a5c26877-e89c-440b-b7a0-31552865fff5"));

  if (internalJob !== undefined) {
    // It is not reading this line of code. 
    const displayInternalForm = true;
  }

}
Run Code Online (Sandbox Code Playgroud)

reactjs react-native next.js

1
推荐指数
1
解决办法
168
查看次数

标签 统计

next.js ×1

react-native ×1

reactjs ×1