首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试使用语义组件时出错

尝试使用语义组件时出错
EN

Stack Overflow用户
提问于 2018-08-23 22:46:10
回答 1查看 301关注 0票数 0

我正在尝试使用语义UI React转换组件。我已经安装并导入了语义:

代码语言:javascript
复制
import { 
  Transition,
 } from "semantic-ui-react";

import 'semantic-ui-css/semantic.min.css';

当我尝试使用它时:

代码语言:javascript
复制
return (
  <div> 
    {
      <div>
      <Transition
        visible={this.state.shouldShowMessageBar}
        animation="scale"
        duration={500}>
          <MessageBar
            messageBarType={ this.state.messageBarStatus.type }
            onDismiss={ () => this.setState({ shouldShowMessageBar: false }) }
          >
            { this.state.messageBarStatus.description }
          </MessageBar>
       </Transition>

      .../

      </div>
    }
  </div>
);

它给出一个警告:

代码语言:javascript
复制
Warning - [webpack] 'dist':
./node_modules/semantic-ui-react/dist/es/lib/shallowEqual.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* C:\...\Dev\truckDeliverySchedule\node_modules\source-map-loader\index.js!C:\...\Dev\truckDeliverySchedule\node_modules\semantic-ui-react\dist\es\lib\shallowEqual.js
    Used by 1 module(s), i. e.
    C:\...\Dev\truckDeliverySchedule\node_modules\source-map-loader\index.js!C:\...\Dev\truckDeliverySchedule\node_modules\semantic-ui-react\dist\es\lib\index.js
* C:\...\Dev\truckDeliverySchedule\node_modules\source-map-loader\index.js!C:\...\Dev\truckDeliverySchedule\node_modules\semantic-ui-react\dist\es\lib\shallowequal.js
    Used by 2 module(s), i. e.
    C:\...\Dev\truckDeliverySchedule\node_modules\source-map-loader\index.js!C:\...\Dev\truckDeliverySchedule\node_modules\semantic-ui-react\dist\es\lib\shallowEqual.js

我还导入了十几个Office UI Fabric React组件:

代码语言:javascript
复制
../
import { 
  Dialog,
  DialogType,
  DialogFooter,
} from 'office-ui-fabric-react/lib/dialog';
import { 
  MessageBar,
  MessageBarType,
} from 'office-ui-fabric-react/lib/messageBar';
../

我不确定这个错误是什么意思,也不知道如何修复它。

编辑:

代码语言:javascript
复制
├─ webpack-dev-middleware@1.12.2
├─ webpack-sources@1.1.0
├─ webpack-stream@4.0.3
├─ webpack@3.11.0

..。

代码语言:javascript
复制
├─ semantic-ui-css@2.3.3
├─ semantic-ui-react@0.82.3

..。

代码语言:javascript
复制
├─ react-dom@15.6.2
├─ react@15.6.2
EN

回答 1

Stack Overflow用户

发布于 2018-08-28 00:12:11

您使用的是较旧版本的React。SUIR had a breaking change at 0.82.0 updating to React 16+。你需要使用Suir0.81.0或者更新你的React版本到16+。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51988500

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档