无法通过有丝分裂从构建器格式编译 React 组件



我已经在我的Node.js项目上安装了Mitosis,为输出文件创建目录build,并使用链接https://github.com/builderio/mitosis#at-a-glance中的代码创建输入文件component.jsx

如果我运行命令

mitosis compile -t react --out=build/myCustomName.js component.jsx

一切正常

但是当我通过链接https://mitosis.builder.io将JSX代码粘贴到他们的活动编译器的左列时,将其编译为JSON,然后将输出JSON代码复制粘贴到文件组件中。Json并运行命令

mitosis compile -t react -f builder --out=build/myCustomName.js component.json

我收到的文件myCustomName.js只有以下代码

import { useContext } from "react";
export default function MyComponent(props) {
return <></>;
}

为什么?如何解决这个问题?

p。正如我所理解的输入格式builder意味着他们的JSON,对吧?

Ok,现在我看到输入格式builder也是JSON,但它与mitosis.builder.io中的JSON输出格式不同。问题解决。

最新更新