【问题标题】:Why after i import React Bootstrap my previous button design not work?为什么在我导入 React Bootstrap 后,我之前的按钮设计不起作用?
【发布时间】:2021-03-24 02:02:19
【问题描述】:

在我import 'bootstrap/dist/css/bootstrap.min.css';@App.js 之后,我以前的按钮设计不像颜色和大小那样工作。
我为按钮设计创建了 button.jsbutton.css
并使用import { Button } from './Button'; 链接它。
我正在使用{button && <Button buttonStyle='btn--outline'>register</Button>} 来使用按钮

【问题讨论】:

    标签: css reactjs react-bootstrap


    【解决方案1】:

    如果你的组件叫Button,而react-bootstrap组件也叫Button,那就有冲突了。

    更改组件的名称(例如 CustomButton)

    查看此页面和我的演示:How do I use custom Button and Bootstrap Button In a React App for Different Pages?

    【讨论】:

      猜你喜欢
      • 2021-11-19
      • 2022-01-23
      • 2021-12-15
      • 2021-12-15
      • 1970-01-01
      • 2020-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多