Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 语义ui react\uuuuu webpack\uuuu require\uuuuuu.i(…)不是一个函数_Reactjs_Webpack_Semantic Ui - Fatal编程技术网

Reactjs 语义ui react\uuuuu webpack\uuuu require\uuuuuu.i(…)不是一个函数

Reactjs 语义ui react\uuuuu webpack\uuuu require\uuuuuu.i(…)不是一个函数,reactjs,webpack,semantic-ui,Reactjs,Webpack,Semantic Ui,我使用的是React样板文件版本3.4.0,从语义ui React导入组件时,出现以下错误: Dynamic page loading failed TypeError: __webpack_require__.i(...) is not a function at new Button (Button.js:83) at eval (ReactCompositeComponent.js:295) at measureLifeCyclePerf (ReactComposi

我使用的是React样板文件版本3.4.0,从语义ui React导入组件时,出现以下错误:

Dynamic page loading failed TypeError: __webpack_require__.i(...) is not a function
    at new Button (Button.js:83)
    at eval (ReactCompositeComponent.js:295)
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (ReactCompositeComponent.js:294)
    at ReactCompositeComponentWrapper._constructComponent (ReactCompositeComponent.js:280)
    at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:188)
    at Object.mountComponent (ReactReconciler.js:46)
    at ReactDOMComponent.mountChildren (ReactMultiChild.js:238)
    at ReactDOMComponent._createInitialChildren (ReactDOMComponent.js:691)
    at ReactDOMComponent.mountComponent (ReactDOMComponent.js:516)
我正在使用导入按钮组件

import { Button } from 'semantic-ui-react'
但最让我吃惊的是,对于某些组件,导入是有效的:

import { Grid } from 'semantic-ui-react'
工作

此外,当我在渲染函数之外记录组件时:

console.log(<Button></Button>)
好的,问题解决了(在StackOverflow上发布后搜索了一晚10分钟,我找到了解决方案:p)

我使用的语义ui react版本与我使用的react 16和react 15兼容

然后,我使用

yarn add semantic-ui-react@0.81.3

尝试重新安装语义ui包。
yarn add semantic-ui-react@0.81.3