reactjs - _0 不是推送到生产时的函数错误
问题描述
我的网站在 localhost 中运行,但使用 netlify 和 vercel 时它不起作用。我设法找到了错误,它似乎与反应降价有关。如果我删除代码,我的网站会成功推送到 netlify 和 vercel。这是代码:
<ReactMarkdown
children={currentNote ? currentNote.description : ""}
components={components}
/>
const components: ReactMarkdownOptions["components"] = {
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || "");
return !inline && match ? (
<SyntaxHighlighter
style={a11yDark}
language={match[1]}
PreTag="div"
showLineNumbers
children={String(children).replace(/\n$/, "")}
{...props}
/>
) : (
<code className={className} {...props}>
{children}
</code>
);
},
};
解决方案
推荐阅读
- if-statement - Makeifle:如果定义块中的条件块
- python - DJANGO ORM - 在案例中使用时间列表更新/添加字段
- bash - 在 wget 中处理超时
- java - java.sql.SQLException:找不到合适的驱动程序(ide android studio)
- javascript - 如何在三个js中将X标记放在框的顶部
- flutter - Flutter:如何创建一个常量/最终数组,以便我可以使用 switch 语句中的值?
- r - 不处理 r 中的 trycatch
- python - 通过 python-social-auth 创建用户配置文件
- java - vs code 无法识别 lombok
- javascript - NodeJs - 如何使用来自另一个模型的数据填充模型视图