首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >React bulma组件导入不起作用

React bulma组件导入不起作用
EN

Stack Overflow用户
提问于 2019-11-11 15:03:01
回答 1查看 1.1K关注 0票数 2

我已经使用CRA (CREATE-REACT-APP)创建了react应用程序。我已经安装了node-sass并将App.css重命名为App.scss,并在App.js中更新了它的导入。现在,在我的App.js中,我只是尝试在一个节中打印一些文本。

This is the link the repo, I am talking about. For your reference

node -v v12.11.1和npm -v 6.11.3

App.js

代码语言:javascript
代码运行次数:0
运行
复制
import React from 'react';
import './App.scss';
import Section from 'react-bulma-components/lib/components/section';

function App() {
  return (
    <Section>
      <div class="container">
        <h1 class="title">
          Hello World
      </h1>
        <p class="subtitle">
          My first website with <strong>Bulma</strong>!
      </p>
      </div>
    </Section>
  );
}

export default App;

App.scss

代码语言:javascript
代码运行次数:0
运行
复制
@import 'react-bulma-components/src/index.sass';

package.json

代码语言:javascript
代码运行次数:0
运行
复制
{
  "name": "just-trying",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "node-sass": "^4.13.0",
    "react": "^16.11.0",
    "react-bulma-components": "^3.1.3",
    "react-dom": "^16.11.0",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "sass-loader": "^8.0.0"
  }
}
EN

回答 1

Stack Overflow用户

发布于 2019-11-11 18:03:03

我没有降级node的版本,而是卸载了react- bulma -component,而只是通过npm i bulma这样的npa安装bulma。这很好用。

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

https://stackoverflow.com/questions/58796858

复制
相关文章

相似问题

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