[英]`ReferenceError: React is not defined` in vue3 jsx files
i am trying to implement storybook with antdv , when I import a tsx file which returns jsx inside button.stories.js, I got "ReferenceError: React is not defined" you can see error here but react is not the part of this project at all, it is a vue js project and all tsx and jsx is returned from tsx files but under the hood they are all vue js files as they use vue js features.我正在尝试使用antdv实现故事书,当我导入一个在 button.stories.js 中返回 jsx 的 tsx 文件时,我得到“ReferenceError: React is not defined”你可以在这里看到错误,但 react 不是这个项目的一部分总而言之,它是一个 vue js 项目,所有 tsx 和 jsx 都是从 tsx 文件返回的,但在幕后它们都是 vue js 文件,因为它们使用 vue js 功能。
all kind of help is appreciated各种帮助表示赞赏
Probably its an error with configuration on JSX transpiler,i think a solution can be import react even if you don't use it import React from 'react';可能是 JSX 转译器上的配置错误,我认为即使您不使用它也可以导入反应解决方案 import React from 'react';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.