Semantic-UI Image properties not working with semantic-ui-react

走远了吗. 提交于 2020-01-24 12:12:27

问题


I´m trying to use the official semantic-ui-react for the first time with React. I´ve built a brand new react application:

$ create-react-app test

And I then tried to add the same react image as follows in App.js:

import React, { Component } from 'react';
import logo from './logo.svg';
import { Image } from 'semantic-ui-react';

import './App.css';


class App extends Component {
  render() {
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to React</h2>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>

        <div className="ui container">
          <h1>Hello World</h1>
          <Image src={logo} avatar/>
          <Image src={logo} size='mini'/>
        </div>

      </div>
    );
  }
}

export default App;

The result shows me 2 big react {logo} images, not mini or avatar styled:

Ideas of what I´m missing here ?


回答1:


Semantic UI React requires a Semantic UI' CSS, you forgot to setup it, here is instuctions. We will also add an example setup with CRA soon.



来源:https://stackoverflow.com/questions/44609711/semantic-ui-image-properties-not-working-with-semantic-ui-react

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!