【发布时间】:2023-02-24 18:18:33
【问题描述】:
如果在反应中满足条件,我如何将 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;
}
}
【问题讨论】:
-
不能用“let”代替const吗?
标签: reactjs react-native next