小编Thi*_*ues的帖子

Error when importing JSX files from another package in monorepo with React

I created a simple project to study monorepo. The example consists of three React applications, where one consists of a lib of components with the Storybook and the other two will import the components of this package.

但是我无法从另一个包中导入组件。当我导入一个常用函数时,没有发生错误。

Github 存储库

错误信息

../components/src/button/Button.js
SyntaxError: /home/thiago/Documentos/Dev/projects/learn-monorepo/packages/components/src/button/Button.js: Support for the experimental syntax 'jsx' isn't currently enabled (7:5):

   5 | function Button({label, ...rest}) {
   6 |   return (
>  7 |     <div>
     |     ^
   8 |       <button {...rest}>
   9 |         {label}
  10 |       </button> …
Run Code Online (Sandbox Code Playgroud)

reactjs babeljs lerna monorepo

3
推荐指数
1
解决办法
515
查看次数

标签 统计

babeljs ×1

lerna ×1

monorepo ×1

reactjs ×1