这里是一个初学者,但我正在努力让以下内容发挥作用。我这里有一个 if else 条件,我希望标签消息依赖,但我收到一条错误消息 Cannot find name 'message' 我做错了什么?if else 条件如下:
if(devEnv()) {
const message = useMessageAsString(
<FormattedMessage
id="xxxxxx"
defaultMessage="I've read and accept the <aTerms>Terms of Use</aTerms> and <aPrivacy>Privacy Policy</aPrivacy>"
values={{
aTerms: (msg: string) => (
<a
rel="noreferrer noopener"
target="_blank"
href={URL_TERMS_AND_CONDITIONS_DEV}
>
{msg}
</a>
),
aPrivacy: (msg: string) => (
<a
rel="noreferrer noopener"
target="_blank"
href={URL_PRIVACY_POLICY}
>
{msg}
</a>
),
}}
/>
)
} else {
const message = useMessageAsString(
<FormattedMessage
id="xxxxx"
defaultMessage="I've read and accept the <aTerms>Terms of Use</aTerms> and …Run Code Online (Sandbox Code Playgroud)