2

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:

enter image description here

Ideas of what I´m missing here ?

1
  • I have tried to re-implement your example code but I'm getting the same render as you. I'm as stuck as you are, but looking into it. Commented Jun 17, 2017 at 23:08

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

0

You might have found your answer already, but not seeing it here, so adding solution for the same error I got while using Image component with svg icon

import { Image } from 'semantic-ui-react';
import { ReactComponent as Logo } from './logo.svg';

<div className="ui container">
    <h1>Hello World</h1>
    <Image as={Logo} title="logo" avatar />
</div>

Hope this helps some one!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.