在我的src/styles/variables.scss文件中,我已经$primary-color: #171b42;定义了。
我想在我的src/components/LandingPage/LandingPage.module.scss文件中使用这个变量。
在这个文件中,我有:
@use "../../styles/variables.scss" as v;
$color: v.$primary-color;
.heading {
color: $color;
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
SassError: Invalid CSS after "$color: v": expected expression (e.g. 1px, bold), was ".$primary-color;"
我究竟做错了什么?我已经node-sass安装
每当用户单击继续按钮时,就会触发一个函数,在该函数中,我调用:
push("/signup/page-2", undefined, { shallow: true });
所有看起来像/signup/[page].js这样的动态路由都会返回<Component />
我也有一个/signup/index.js返回<Component />
问题是:
每次push("/signup/page-2", undefined, { shallow: true });调用页面都会重新加载并清除所有状态。
还值得一提的是,这个应用程序是一个带有 react-router-dom 应用程序的 CRA,它被转换为 next.js 应用程序